From 2a1f80e671197bc48d4bba6ea8c9b2a1e8167e1f Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Sat, 6 Aug 2011 11:51:33 -0700 Subject: [PATCH] --- yaml --- r: 262572 b: refs/heads/master c: 1117f72ea0217ba0cc19f05adbbd8b9a397f5ab7 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/fs/proc/base.c | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index 4fc272ed4ac7..2a0bf88ae077 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: c21427043dec93d40e3a1af970831d1f5f15ce5d +refs/heads/master: 1117f72ea0217ba0cc19f05adbbd8b9a397f5ab7 diff --git a/trunk/fs/proc/base.c b/trunk/fs/proc/base.c index 73a562bf7266..5eb02069e1b8 100644 --- a/trunk/fs/proc/base.c +++ b/trunk/fs/proc/base.c @@ -1919,6 +1919,14 @@ static int proc_fd_info(struct inode *inode, struct path *path, char *info) spin_lock(&files->file_lock); file = fcheck_files(files, fd); if (file) { + unsigned int f_flags; + struct fdtable *fdt; + + fdt = files_fdtable(files); + f_flags = file->f_flags & ~O_CLOEXEC; + if (FD_ISSET(fd, fdt->close_on_exec)) + f_flags |= O_CLOEXEC; + if (path) { *path = file->f_path; path_get(&file->f_path); @@ -1928,7 +1936,7 @@ static int proc_fd_info(struct inode *inode, struct path *path, char *info) "pos:\t%lli\n" "flags:\t0%o\n", (long long) file->f_pos, - file->f_flags); + f_flags); spin_unlock(&files->file_lock); put_files_struct(files); return 0;