diff options
author | Nicolas Lacasse <nlacasse@google.com> | 2019-03-28 14:14:13 -0700 |
---|---|---|
committer | Shentubot <shentubot@google.com> | 2019-03-28 14:15:23 -0700 |
commit | 99195b0e166536dd81c7096c0dc0f2cc527f1553 (patch) | |
tree | 5717a3935f95be65dc971fa9ec40dc0b850736e2 /pkg/sentry/syscalls/linux/sys_file.go | |
parent | f2e5dcf21c270d5d56da63e03ed204845e192e56 (diff) |
Setting timestamps should trigger an inotify event.
PiperOrigin-RevId: 240850187
Change-Id: I1458581b771a1031e47bba439e480829794927b8
Diffstat (limited to 'pkg/sentry/syscalls/linux/sys_file.go')
-rw-r--r-- | pkg/sentry/syscalls/linux/sys_file.go | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/pkg/sentry/syscalls/linux/sys_file.go b/pkg/sentry/syscalls/linux/sys_file.go index 3193718b5..5a874d935 100644 --- a/pkg/sentry/syscalls/linux/sys_file.go +++ b/pkg/sentry/syscalls/linux/sys_file.go @@ -1698,7 +1698,13 @@ func utimes(t *kernel.Task, dirFD kdefs.FD, addr usermem.Addr, ts fs.TimeSpec, r } } - return d.Inode.SetTimestamps(t, d, ts) + if err := d.Inode.SetTimestamps(t, d, ts); err != nil { + return err + } + + // File attribute changed, generate notification. + d.InotifyEvent(linux.IN_ATTRIB, 0) + return nil } // From utimes.c: |