提交 d5bd7dd5 编写于 作者: R Rich Felker

in faccessat slow path, add close-on-exec to pipe fds

as usual, this is needed to avoid fd leaks. as a better solution, the
use of fds could possibly be replaced with mmap and a futex.
上级 51635856
......@@ -34,7 +34,7 @@ int faccessat(int fd, const char *filename, int amode, int flag)
sigset_t set;
int ret, p[2];
if (pipe(p)) return __syscall_ret(-EBUSY);
if (pipe2(p, O_CLOEXEC)) return __syscall_ret(-EBUSY);
struct ctx c = { .fd = fd, .filename = filename, .amode = amode, .p = p[1] };
__block_all_sigs(&set);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册