aboutsummaryrefslogtreecommitdiff
path: root/src/common/util.h
diff options
context:
space:
mode:
authorGeorge Kadianakis <desnacked@gmail.com>2011-10-24 15:55:53 +0200
committerGeorge Kadianakis <desnacked@gmail.com>2011-10-24 15:55:53 +0200
commitf12a40d8603a7e3e215652fe3bb54e2e1566646c (patch)
tree34ed9bb7a70f569965f8b93507e89af930eac14f /src/common/util.h
parent45307ff98038b2bed7263194c8d5cf56d87f4de4 (diff)
downloadtor-f12a40d8603a7e3e215652fe3bb54e2e1566646c.tar
tor-f12a40d8603a7e3e215652fe3bb54e2e1566646c.tar.gz
Prepare util.[ch] to use the new process_handle_t API.
Also, create tor_process_destroy() which destroys a process_handle_t.
Diffstat (limited to 'src/common/util.h')
-rw-r--r--src/common/util.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/common/util.h b/src/common/util.h
index c5a52d11c..b9f3a5bc5 100644
--- a/src/common/util.h
+++ b/src/common/util.h
@@ -360,10 +360,14 @@ void write_pidfile(char *filename);
void tor_check_port_forwarding(const char *filename,
int dir_port, int or_port, time_t now);
-int tor_terminate_process(pid_t pid);
typedef struct process_handle_s process_handle_t;
int tor_spawn_background(const char *const filename, const char **argv,
- const char **envp, process_handle_t *process_handle);
+#ifdef MS_WINDOWS
+ LPVOID envp,
+#else
+ const char **envp,
+#endif
+ process_handle_t *process_handle);
#define SPAWN_ERROR_MESSAGE "ERR: Failed to spawn background process - code "
@@ -413,6 +417,10 @@ 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[]);
+int tor_terminate_process(process_handle_t *process_handle);
+void tor_process_destroy(process_handle_t *process_handle,
+ int also_terminate_process);
+
#ifdef UTIL_PRIVATE
/* Prototypes for private functions only used by util.c (and unit tests) */