projects
/
oweals
/
musl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5163585
)
in faccessat slow path, add close-on-exec to pipe fds
author
Rich Felker
<dalias@aerifal.cx>
Fri, 18 Oct 2013 11:12:38 +0000
(07:12 -0400)
committer
Rich Felker
<dalias@aerifal.cx>
Fri, 18 Oct 2013 11:12:38 +0000
(07:12 -0400)
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.
src/unistd/faccessat.c
patch
|
blob
|
history
diff --git
a/src/unistd/faccessat.c
b/src/unistd/faccessat.c
index 1083467f8e442b90dd38002d602cbb1ee7d73f2e..821e13f57504edbe6f6664379abe88ce11755f9d 100644
(file)
--- a/
src/unistd/faccessat.c
+++ b/
src/unistd/faccessat.c
@@
-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 (pipe
2(p, O_CLOEXEC
)) return __syscall_ret(-EBUSY);
struct ctx c = { .fd = fd, .filename = filename, .amode = amode, .p = p[1] };
__block_all_sigs(&set);