aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSteven Murdoch <Steven.Murdoch@cl.cam.ac.uk>2010-12-01 16:27:21 +0000
committerNick Mathewson <nickm@torproject.org>2010-12-01 12:22:21 -0500
commitd5127ebdd86a5f2910e5cc6a0690fa6fac01f8db (patch)
tree584ab96bab5ea0c978528038ce8d558a802926c5 /src
parent9908404f0189aad3917960ba63661079e546f150 (diff)
downloadtor-d5127ebdd86a5f2910e5cc6a0690fa6fac01f8db.tar.gz
tor-d5127ebdd86a5f2910e5cc6a0690fa6fac01f8db.zip
Fix connecting the stdin of tor-fw-helper to /dev/null
This wasn't working due to the parameters of dup2 being in the wrong order. As a result, tor-fw-helper was inheriting the stdin of Tor.
Diffstat (limited to 'src')
-rw-r--r--src/common/util.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/common/util.c b/src/common/util.c
index 421da3560c..95d2b87c5d 100644
--- a/src/common/util.c
+++ b/src/common/util.c
@@ -2988,7 +2988,7 @@ tor_spawn_background(const char *const filename, int *stdout_read,
/* Link stdin to /dev/null */
fd = open("/dev/null", O_RDONLY); /* NOT cloexec, obviously. */
if (fd != -1)
- dup2(STDIN_FILENO, fd);
+ dup2(fd, STDIN_FILENO);
else
goto error;