about summary refs log tree commit diff
path: root/src/stdio/popen.c
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2013-09-01 17:02:35 -0400
committerRich Felker <dalias@aerifal.cx>2013-09-01 17:02:35 -0400
commitfe80a8eb687f48f08e393522520f69b0c52cb297 (patch)
treed23f104810e7ea3ef47424c5c5493d37ba6cb205 /src/stdio/popen.c
parentc2d3fd3aad854af2875cff412cf52cead0a83a51 (diff)
downloadmusl-fe80a8eb687f48f08e393522520f69b0c52cb297.tar.gz
musl-fe80a8eb687f48f08e393522520f69b0c52cb297.tar.xz
musl-fe80a8eb687f48f08e393522520f69b0c52cb297.zip
fix special-case breakage in popen due to reversed argument order
Diffstat (limited to 'src/stdio/popen.c')
-rw-r--r--src/stdio/popen.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/stdio/popen.c b/src/stdio/popen.c
index 28ff23fd..92cb57ee 100644
--- a/src/stdio/popen.c
+++ b/src/stdio/popen.c
@@ -39,7 +39,7 @@ FILE *popen(const char *cmd, const char *mode)
 	 * remove the close-on-exec flag in the child without also creating
 	 * a file descriptor leak race condition in the parent. */
 	if (p[1-op] == 1-op) {
-		int tmp = fcntl(F_DUPFD_CLOEXEC, 1-op, 0);
+		int tmp = fcntl(1-op, F_DUPFD_CLOEXEC, 0);
 		if (tmp < 0) {
 			e = errno;
 			goto fail;