summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/fsimpl/ext/directory.go
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2020-02-14 14:39:40 -0800
committergVisor bot <gvisor-bot@google.com>2020-02-14 14:40:35 -0800
commit3557b2665198b57c04924ad4be8dbf9e42cedf71 (patch)
tree1c7bf6101388a1a59b8fd18337e36e5a7d367d3c /pkg/sentry/fsimpl/ext/directory.go
parent87bc2834c97a958d0762833fe8db749ccc6d5d50 (diff)
Allow vfs.IterDirentsCallback.Handle() to return an error.
This is easier than storing errors from e.g. CopyOut in the callback. PiperOrigin-RevId: 295230021
Diffstat (limited to 'pkg/sentry/fsimpl/ext/directory.go')
-rw-r--r--pkg/sentry/fsimpl/ext/directory.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/pkg/sentry/fsimpl/ext/directory.go b/pkg/sentry/fsimpl/ext/directory.go
index ebb72b75e..bd6ede995 100644
--- a/pkg/sentry/fsimpl/ext/directory.go
+++ b/pkg/sentry/fsimpl/ext/directory.go
@@ -188,14 +188,14 @@ func (fd *directoryFD) IterDirents(ctx context.Context, cb vfs.IterDirentsCallba
childType = fs.ToInodeType(childInode.diskInode.Mode().FileType())
}
- if !cb.Handle(vfs.Dirent{
+ if err := cb.Handle(vfs.Dirent{
Name: child.diskDirent.FileName(),
Type: fs.ToDirentType(childType),
Ino: uint64(child.diskDirent.Inode()),
NextOff: fd.off + 1,
- }) {
+ }); err != nil {
dir.childList.InsertBefore(child, fd.iter)
- return nil
+ return err
}
fd.off++
}