diff options
author | Nick Mathewson <nickm@torproject.org> | 2016-05-04 15:12:20 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2016-05-04 15:12:20 -0400 |
commit | 2384256a3719fbc31793228b0b34716b7817d15e (patch) | |
tree | e4eec44a1194ee0cd01557fba8f36a9af209dbc1 /src/common/util.c | |
parent | e24c9022722119f4d0d631c7e4d02e347b9dc83d (diff) | |
parent | b8e8910d60e41844ce4ab37d9306cb8e8b5aec91 (diff) | |
download | tor-2384256a3719fbc31793228b0b34716b7817d15e.tar.gz tor-2384256a3719fbc31793228b0b34716b7817d15e.zip |
Merge branch 'maint-0.2.8'
Diffstat (limited to 'src/common/util.c')
-rw-r--r-- | src/common/util.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/common/util.c b/src/common/util.c index de6867e47a..fa2953cc30 100644 --- a/src/common/util.c +++ b/src/common/util.c @@ -3911,8 +3911,13 @@ format_helper_exit_status(unsigned char child_state, int saved_errno, /* Maximum number of file descriptors, if we cannot get it via sysconf() */ #define DEFAULT_MAX_FD 256 -/** Terminate the process of <b>process_handle</b>. - * Code borrowed from Python's os.kill. */ +/** Terminate the process of <b>process_handle</b>, if that process has not + * already exited. + * + * Return 0 if we succeeded in terminating the process (or if the process + * already exited), and -1 if we tried to kill the process but failed. + * + * Based on code originally borrowed from Python's os.kill. */ int tor_terminate_process(process_handle_t *process_handle) { @@ -3932,7 +3937,7 @@ tor_terminate_process(process_handle_t *process_handle) } #endif - return -1; + return 0; /* We didn't need to kill the process, so report success */ } /** Return the Process ID of <b>process_handle</b>. */ |