X-Git-Url: http://git.monstr.eu/?a=blobdiff_plain;f=fs%2Ffile.c;h=c0b60961c67222fe95e60641313192f494dcde48;hb=1375b9803e007842493c64d0d73d7dd0e385e17c;hp=8434e0afecc7328a2b53ad2c110f9c80db428150;hpb=f67d6620e413a167e861ce5733c1be5a2384e0c4;p=linux-2.6-microblaze.git diff --git a/fs/file.c b/fs/file.c index 8434e0afecc7..c0b60961c672 100644 --- a/fs/file.c +++ b/fs/file.c @@ -694,8 +694,10 @@ int __close_range(unsigned fd, unsigned max_fd, unsigned int flags) * If the requested range is greater than the current maximum, * we're closing everything so only copy all file descriptors * beneath the lowest file descriptor. + * If the caller requested all fds to be made cloexec copy all + * of the file descriptors since they still want to use them. */ - if (max_fd >= cur_max) + if (!(flags & CLOSE_RANGE_CLOEXEC) && (max_fd >= cur_max)) max_unshare_fds = fd; ret = unshare_fd(CLONE_FILES, max_unshare_fds, &fds);