diff options
author | Steven Murdoch <Steven.Murdoch@cl.cam.ac.uk> | 2011-08-23 01:09:24 +0100 |
---|---|---|
committer | Steven Murdoch <Steven.Murdoch@cl.cam.ac.uk> | 2011-08-23 01:09:24 +0100 |
commit | 2efafdfe14411b800e9350e527955ca74f3c704b (patch) | |
tree | acaa6ecbac09099e07608562756114563c1c508c /src/common/util.c | |
parent | 50504fc4cb1a626b180b786b261aa59c928e269f (diff) | |
download | tor-2efafdfe14411b800e9350e527955ca74f3c704b.tar.gz tor-2efafdfe14411b800e9350e527955ca74f3c704b.zip |
Fix compilation errors under *nix
Diffstat (limited to 'src/common/util.c')
-rw-r--r-- | src/common/util.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/common/util.c b/src/common/util.c index 36b59662bc..f25dd43b60 100644 --- a/src/common/util.c +++ b/src/common/util.c @@ -3071,6 +3071,7 @@ tor_spawn_background(const char *const filename, const char **argv) saAttr.lpSecurityDescriptor = NULL; /* Assume failure to start process */ + memset(&process_handle, 0, sizeof(process_handle)); process_handle.status = -1; /* Set up pipe for stdout */ @@ -3167,6 +3168,7 @@ tor_spawn_background(const char *const filename, const char **argv) static int max_fd = -1; /* Assume failure to start */ + memset(&process_handle, 0, sizeof(process_handle)); process_handle.status = -1; /* We do the strlen here because strlen() is not signal handler safe, @@ -3374,8 +3376,6 @@ tor_get_exit_code(const process_handle_t process_handle, return -1; } } - - return 0; #else int stat_loc; int retval; @@ -3398,6 +3398,8 @@ tor_get_exit_code(const process_handle_t process_handle, if (exit_code != NULL) *exit_code = WEXITSTATUS(stat_loc); #endif // MS_WINDOWS + + return 0; } #ifdef MS_WINDOWS @@ -3667,7 +3669,8 @@ tor_check_port_forwarding(const char *filename, int dir_port, int or_port, "Started port forwarding helper (%s)", filename); #else log_info(LD_GENERAL, - "Started port forwarding helper (%s) with pid %d", filename, child_pid); + "Started port forwarding helper (%s) with pid %d", filename, + child_handle.pid); #endif } |