diff options
-rw-r--r-- | fs/open.c | 2 | ||||
-rw-r--r-- | fs/proc/fd.c | 2 |
2 files changed, 2 insertions, 2 deletions
@@ -814,7 +814,7 @@ static inline int build_open_flags(int flags, umode_t mode, struct open_flags *o | |||
814 | op->mode = 0; | 814 | op->mode = 0; |
815 | 815 | ||
816 | /* Must never be set by userspace */ | 816 | /* Must never be set by userspace */ |
817 | flags &= ~FMODE_NONOTIFY; | 817 | flags &= ~FMODE_NONOTIFY & ~O_CLOEXEC; |
818 | 818 | ||
819 | /* | 819 | /* |
820 | * O_SYNC is implemented as __O_SYNC|O_DSYNC. As many places only | 820 | * O_SYNC is implemented as __O_SYNC|O_DSYNC. As many places only |
diff --git a/fs/proc/fd.c b/fs/proc/fd.c index 9cef449c0f76..f28a875f8779 100644 --- a/fs/proc/fd.c +++ b/fs/proc/fd.c | |||
@@ -36,7 +36,7 @@ static int seq_show(struct seq_file *m, void *v) | |||
36 | if (file) { | 36 | if (file) { |
37 | struct fdtable *fdt = files_fdtable(files); | 37 | struct fdtable *fdt = files_fdtable(files); |
38 | 38 | ||
39 | f_flags = file->f_flags & ~O_CLOEXEC; | 39 | f_flags = file->f_flags; |
40 | if (close_on_exec(fd, fdt)) | 40 | if (close_on_exec(fd, fdt)) |
41 | f_flags |= O_CLOEXEC; | 41 | f_flags |= O_CLOEXEC; |
42 | 42 | ||