From fe80a8eb687f48f08e393522520f69b0c52cb297 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Sun, 1 Sep 2013 17:02:35 -0400 Subject: [PATCH] fix special-case breakage in popen due to reversed argument order --- src/stdio/popen.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- 2.25.1