fix some more O_CLOEXEC/SOCK_CLOEXEC issues

This commit is contained in:
Rich Felker
2012-09-29 17:59:50 -04:00
parent 3609e019f3
commit f2d08cf755
4 changed files with 5 additions and 7 deletions

View File

@ -19,7 +19,7 @@ char *realpath(const char *restrict filename, char *restrict resolved)
return 0;
}
fd = open(filename, O_RDONLY|O_NONBLOCK);
fd = open(filename, O_RDONLY|O_NONBLOCK|O_CLOEXEC);
if (fd < 0) return 0;
snprintf(buf, sizeof buf, "/proc/self/fd/%d", fd);