This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients neologix, vstinner
Date 2013-01-12.14:54:12
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1358002453.56.0.227593845503.issue16946@psf.upfronthosting.co.za>
In-reply-to
Content
The following extract of _close_open_fd_range_safe() is not correct:

#ifdef O_CLOEXEC
    fd_dir_fd = open(FD_DIR, O_RDONLY | O_CLOEXEC, 0);
#else
    fd_dir_fd = open(FD_DIR, O_RDONLY, 0);
#ifdef FD_CLOEXEC
    {
        int old = fcntl(fd_dir_fd, F_GETFD);
        if (old != -1)
            fcntl(fd_dir_fd, F_SETFD, old | FD_CLOEXEC);
    }
#endif
#endif

On Linux older than 2.6.23, O_CLOEXEC may be defined by the glibc whereas the kernel does not support it. In this case, the flag is simply ignored and close-on-exec flag is not set on the file descriptor.
History
Date User Action Args
2013-01-12 14:54:13vstinnersetrecipients: + vstinner, neologix
2013-01-12 14:54:13vstinnersetmessageid: <1358002453.56.0.227593845503.issue16946@psf.upfronthosting.co.za>
2013-01-12 14:54:13vstinnerlinkissue16946 messages
2013-01-12 14:54:12vstinnercreate