diff options
author | Steven Murdoch <Steven.Murdoch@cl.cam.ac.uk> | 2011-08-28 23:35:02 +0100 |
---|---|---|
committer | Steven Murdoch <Steven.Murdoch@cl.cam.ac.uk> | 2011-08-28 23:35:02 +0100 |
commit | 3f0a197aad3cca6634e4eb63e8441e5507a6b77f (patch) | |
tree | 95258c0f2f0db30f2c7d3aecc17d688f7876cf5d /src/test | |
parent | 1da5081ae0cfaf52f11c0d93c42efa211ead35af (diff) | |
download | tor-3f0a197aad3cca6634e4eb63e8441e5507a6b77f.tar.gz tor-3f0a197aad3cca6634e4eb63e8441e5507a6b77f.zip |
Make signature of tor_spawn_background more conventional
Conventionally in Tor, structs are returned as pointers, so change
tor_spawn_background() to return the process handle in a pointer rather
than as return value.
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/test_util.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/test/test_util.c b/src/test/test_util.c index cb98030ccf..40ab09813b 100644 --- a/src/test/test_util.c +++ b/src/test/test_util.c @@ -1389,9 +1389,9 @@ run_util_spawn_background(const char *argv[], const char *expected_out, /* Start the program */ #ifdef MS_WINDOWS - process_handle = tor_spawn_background(NULL, argv); + tor_spawn_background(NULL, argv, &process_handle); #else - process_handle = tor_spawn_background(argv[0], argv); + tor_spawn_background(argv[0], argv, &process_handle); #endif tt_int_op(process_handle.status, ==, expected_status); @@ -1473,7 +1473,8 @@ test_util_spawn_background_fail(void *ptr) expected_status); } -/** Helper function for testing tor_spawn_background */ +/** Test that reading from a handle returns a partial read rather than + * blocking */ static void test_util_spawn_background_partial_read(void *ptr) { @@ -1499,7 +1500,7 @@ test_util_spawn_background_partial_read(void *ptr) (void)ptr; /* Start the program */ - process_handle = tor_spawn_background(NULL, argv); + tor_spawn_background(NULL, argv, &process_handle); tt_int_op(process_handle.status, ==, expected_status); /* Check stdout */ |