소스 검색

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 15 년 전
부모
커밋
d5127ebdd8
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  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;