summaryrefslogtreecommitdiff
path: root/src/common/util.h
diff options
context:
space:
mode:
authorSteven Murdoch <Steven.Murdoch@cl.cam.ac.uk>2011-08-29 00:30:18 +0100
committerSteven Murdoch <Steven.Murdoch@cl.cam.ac.uk>2011-08-29 00:30:18 +0100
commitf1ff65dfad800ed89e5b01c1c5b4b77c10a438b8 (patch)
tree3e1a41e4c9595742149454b8784f9dc3adbe1194 /src/common/util.h
parent3f0a197aad3cca6634e4eb63e8441e5507a6b77f (diff)
downloadtor-f1ff65dfad800ed89e5b01c1c5b4b77c10a438b8.tar.gz
tor-f1ff65dfad800ed89e5b01c1c5b4b77c10a438b8.zip
Replace two magic tristates with #define'd names
- process_handle_t.status - return value of tor_get_exit_code()
Diffstat (limited to 'src/common/util.h')
-rw-r--r--src/common/util.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/common/util.h b/src/common/util.h
index e0252658ad..d8c73703e2 100644
--- a/src/common/util.h
+++ b/src/common/util.h
@@ -355,8 +355,14 @@ HANDLE load_windows_system_library(const TCHAR *library_name);
#ifdef UTIL_PRIVATE
/* Prototypes for private functions only used by util.c (and unit tests) */
+/* Values of process_handle_t.status. PROCESS_STATUS_NOTRUNNING must be
+ * 0 because tor_check_port_forwarding depends on this being the initial
+ * statue of the static instance of process_handle_t */
+#define PROCESS_STATUS_NOTRUNNING 0
+#define PROCESS_STATUS_RUNNING 1
+#define PROCESS_STATUS_ERROR -1
typedef struct process_handle_s {
- int status; // 0: not running; 1: running; -1: error
+ int status;
#ifdef MS_WINDOWS
HANDLE stdout_pipe;
HANDLE stderr_pipe;
@@ -372,6 +378,11 @@ typedef struct process_handle_s {
int tor_spawn_background(const char *const filename, const char **argv,
process_handle_t *process_handle);
+
+/* Return values of tor_get_exit_code() */
+#define PROCESS_EXIT_RUNNING 1
+#define PROCESS_EXIT_EXITED 0
+#define PROCESS_EXIT_ERROR -1
int tor_get_exit_code(const process_handle_t process_handle,
int block, int *exit_code);
#ifdef MS_WINDOWS