diff options
author | Steven Murdoch <Steven.Murdoch@cl.cam.ac.uk> | 2011-09-01 01:06:12 +0100 |
---|---|---|
committer | Steven Murdoch <Steven.Murdoch@cl.cam.ac.uk> | 2011-09-01 01:43:44 +0100 |
commit | 5b8a20ed447f11cda2e0bf528dd78e41e4b76fa4 (patch) | |
tree | b5b80e82ea6df68b9e6de34966c99185a46de1ac /src/common/util.h | |
parent | 76fde28475a5b977d1fa94d06c116ec39a386ac8 (diff) | |
download | tor-5b8a20ed447f11cda2e0bf528dd78e41e4b76fa4.tar tor-5b8a20ed447f11cda2e0bf528dd78e41e4b76fa4.tar.gz |
Make a version of tor_read_all_handle() for non-Windows platforms
Mainly used for testing reading from subprocesses. To be more generic
we now pass in a pointer to a process_handle_t rather than a Windows-
specific HANDLE.
Diffstat (limited to 'src/common/util.h')
-rw-r--r-- | src/common/util.h | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/common/util.h b/src/common/util.h index 3029425ca..6211267d0 100644 --- a/src/common/util.h +++ b/src/common/util.h @@ -388,12 +388,15 @@ int tor_get_exit_code(const process_handle_t process_handle, int tor_split_lines(struct smartlist_t *sl, char *buf, int len); #ifdef MS_WINDOWS ssize_t tor_read_all_handle(HANDLE h, char *buf, size_t count, - HANDLE hProcess); + const process_handle_t *process); +#else +ssize_t tor_read_all_handle(FILE *h, char *buf, size_t count, + const process_handle_t *process); #endif -ssize_t tor_read_all_from_process_stdout(const process_handle_t process_handle, - char *buf, size_t count); -ssize_t tor_read_all_from_process_stderr(const process_handle_t process_handle, - char *buf, size_t count); +ssize_t tor_read_all_from_process_stdout( + const process_handle_t *process_handle, char *buf, size_t count); +ssize_t tor_read_all_from_process_stderr( + const process_handle_t *process_handle, char *buf, size_t count); char *tor_join_win_cmdline(const char *argv[]); void format_helper_exit_status(unsigned char child_state, int saved_errno, char *hex_errno); |