aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2021-04-20 14:52:08 -0400
committerRich Felker <dalias@aerifal.cx>2021-04-20 14:52:08 -0400
commite74acd59a5c7d56ae0e64c4ffa5043da13ee896e (patch)
tree55fa1f9bc74ca530279c202998c8d1bc95063c31
parent9a40e842dfa5659c149778c5870435eb14439ed6 (diff)
downloadmusl-e74acd59a5c7d56ae0e64c4ffa5043da13ee896e.tar.gz
musl-e74acd59a5c7d56ae0e64c4ffa5043da13ee896e.tar.xz
musl-e74acd59a5c7d56ae0e64c4ffa5043da13ee896e.zip
remove spurious lock in popen
the newly allocated FILE * has not yet leaked to the application and is only visible to stdio internals until popen returns. since we do not change any fields of the structure observed by libc internals, only the pipe_pid member, locking is not necessary.
-rw-r--r--src/stdio/popen.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/src/stdio/popen.c b/src/stdio/popen.c
index b53a5572..19bbe7cf 100644
--- a/src/stdio/popen.c
+++ b/src/stdio/popen.c
@@ -31,7 +31,6 @@ FILE *popen(const char *cmd, const char *mode)
__syscall(SYS_close, p[1]);
return NULL;
}
- FLOCK(f);
e = ENOMEM;
if (!posix_spawn_file_actions_init(&fa)) {
@@ -43,7 +42,6 @@ FILE *popen(const char *cmd, const char *mode)
if (!strchr(mode, 'e'))
fcntl(p[op], F_SETFD, 0);
__syscall(SYS_close, p[1-op]);
- FUNLOCK(f);
return f;
}
}