Browse Source

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.
Steven Murdoch 14 years ago
parent
commit
d5127ebdd8
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/common/util.c

+ 1 - 1
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;