summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/syscalls/linux
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2019-11-15 00:21:07 +0000
committergVisor bot <gvisor-bot@google.com>2019-11-15 00:21:07 +0000
commitd0785245406efbcde2752c8f2822b2fdb303d7cd (patch)
treefcfda77d1d56354718ddc7f65ad2b785d783ef35 /pkg/sentry/syscalls/linux
parent75d810f36b3e702965a280ffd2a4f7521afaa0c0 (diff)
parent339536de5eefe782813aabae4aeeb312b3c4dde7 (diff)
Merge release-20191104.0-43-g339536d (automated)
Diffstat (limited to 'pkg/sentry/syscalls/linux')
-rw-r--r--pkg/sentry/syscalls/linux/sys_file.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/pkg/sentry/syscalls/linux/sys_file.go b/pkg/sentry/syscalls/linux/sys_file.go
index b9a8e3e21..167c2b60b 100644
--- a/pkg/sentry/syscalls/linux/sys_file.go
+++ b/pkg/sentry/syscalls/linux/sys_file.go
@@ -169,10 +169,11 @@ func openAt(t *kernel.Task, dirFD int32, addr usermem.Addr, flags uint) (fd uint
if dirPath {
return syserror.ENOTDIR
}
- if flags&linux.O_TRUNC != 0 {
- if err := d.Inode.Truncate(t, d, 0); err != nil {
- return err
- }
+ }
+
+ if flags&linux.O_TRUNC != 0 {
+ if err := d.Inode.Truncate(t, d, 0); err != nil {
+ return err
}
}