aboutsummaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authorSteven Murdoch <Steven.Murdoch@cl.cam.ac.uk>2010-10-10 18:12:23 +0100
committerSteven Murdoch <Steven.Murdoch@cl.cam.ac.uk>2010-10-10 19:08:44 +0100
commit8a12ce2cf9bb6362e380e7efaee334d82cc3c7c8 (patch)
tree4599c8392a4308011625a7ccfe19e21466c342ba /src/common
parent68e576e9f92e94e27123d47ce27c56426eb06193 (diff)
downloadtor-8a12ce2cf9bb6362e380e7efaee334d82cc3c7c8.tar
tor-8a12ce2cf9bb6362e380e7efaee334d82cc3c7c8.tar.gz
Add a unit test for tor_spawn_background
- Test sucessfully starting a process - Test failing to find the executable
Diffstat (limited to 'src/common')
-rw-r--r--src/common/util.c2
-rw-r--r--src/common/util.h2
2 files changed, 3 insertions, 1 deletions
diff --git a/src/common/util.c b/src/common/util.c
index 402cfbf78..cddc8a9a9 100644
--- a/src/common/util.c
+++ b/src/common/util.c
@@ -2973,7 +2973,7 @@ format_helper_exit_status(unsigned char child_state, int saved_errno,
* -1. Some parts of this code are based on the POSIX subprocess module from
* Python.
*/
-static int
+int
tor_spawn_background(const char *const filename, int *stdout_read,
int *stderr_read, const char **argv)
{
diff --git a/src/common/util.h b/src/common/util.h
index 86555eeb1..8c2a9be32 100644
--- a/src/common/util.h
+++ b/src/common/util.h
@@ -350,6 +350,8 @@ HANDLE load_windows_system_library(const TCHAR *library_name);
#ifdef UTIL_PRIVATE
/* Prototypes for private functions only used by util.c (and unit tests) */
+int tor_spawn_background(const char *const filename, int *stdout_read,
+ int *stderr_read, const char **argv);
void format_helper_exit_status(unsigned char child_state,
int saved_errno, char *hex_errno);