mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-11 13:43:47 +01:00
Note icky constructs mentioned in bug #1903
- To be dealt with as part of bug #2029
This commit is contained in:
parent
5a77c64834
commit
708ba8899f
@ -3061,7 +3061,8 @@ tor_spawn_background(const char *const filename, int *stdout_read,
|
|||||||
child_state = CHILD_STATE_CLOSEFD;
|
child_state = CHILD_STATE_CLOSEFD;
|
||||||
|
|
||||||
/* Close all other fds, including the read end of the pipe */
|
/* Close all other fds, including the read end of the pipe */
|
||||||
/* TODO: use closefrom if available */
|
/* XXX: use closefrom if available, or better still set FD_CLOEXEC
|
||||||
|
on all of Tor's open files */
|
||||||
for (fd = STDERR_FILENO + 1; fd < max_fd; fd++)
|
for (fd = STDERR_FILENO + 1; fd < max_fd; fd++)
|
||||||
close(fd);
|
close(fd);
|
||||||
|
|
||||||
@ -3077,7 +3078,7 @@ tor_spawn_background(const char *const filename, int *stdout_read,
|
|||||||
child_state = CHILD_STATE_FAILEXEC;
|
child_state = CHILD_STATE_FAILEXEC;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
/* TODO: are we leaking fds from the pipe? */
|
/* XXX: are we leaking fds from the pipe? */
|
||||||
|
|
||||||
format_helper_exit_status(child_state, errno, hex_errno);
|
format_helper_exit_status(child_state, errno, hex_errno);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user