mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-28 00:21:52 +03:00
Use O_CLOEXEC in sysconf [BZ #26791]
If sysconf is used in multithreaded processes, various filedescriptors may leak due to missing O_CLOEXEC. This commit adds the flag.
This commit is contained in:
committed by
Arjun Shankar
parent
30af7c7fa1
commit
d2d714b9fc
@ -81,7 +81,7 @@ __sysconf (int name)
|
||||
|
||||
if (procfname != NULL)
|
||||
{
|
||||
int fd = __open_nocancel (procfname, O_RDONLY);
|
||||
int fd = __open_nocancel (procfname, O_RDONLY | O_CLOEXEC);
|
||||
if (fd != -1)
|
||||
{
|
||||
/* This is more than enough, the file contains a single integer. */
|
||||
|
Reference in New Issue
Block a user