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.
This commit is contained in:
Steven Murdoch 2010-12-01 16:27:21 +00:00 committed by Nick Mathewson
parent 9908404f01
commit d5127ebdd8

View File

@ -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;