aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
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;