diff options
author | Christian Grothoff <christian@grothoff.org> | 2010-11-03 21:26:40 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2010-11-03 21:26:40 +0000 |
commit | 721e49caeea6ba5073f8bc5c6c08359295c02bb5 (patch) | |
tree | e06e80ba90af91e9452a48a7a5782913199b4877 /src/util/test_os_start_process.c | |
parent | 37ac1b7c9e9e05f93d4100cfb53450ec2d370989 (diff) | |
download | gnunet-721e49caeea6ba5073f8bc5c6c08359295c02bb5.tar.gz gnunet-721e49caeea6ba5073f8bc5c6c08359295c02bb5.zip |
original patch from Mantis 1614
Diffstat (limited to 'src/util/test_os_start_process.c')
-rw-r--r-- | src/util/test_os_start_process.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/util/test_os_start_process.c b/src/util/test_os_start_process.c index 0b8860c7d..bd2eb2b09 100644 --- a/src/util/test_os_start_process.c +++ b/src/util/test_os_start_process.c | |||
@@ -38,7 +38,7 @@ | |||
38 | static char *test_phrase = "HELLO WORLD"; | 38 | static char *test_phrase = "HELLO WORLD"; |
39 | static int ok; | 39 | static int ok; |
40 | 40 | ||
41 | static pid_t pid; | 41 | static GNUNET_OS_Process *proc; |
42 | /* Pipe to write to started processes stdin (on write end) */ | 42 | /* Pipe to write to started processes stdin (on write end) */ |
43 | static struct GNUNET_DISK_PipeHandle *hello_pipe_stdin; | 43 | static struct GNUNET_DISK_PipeHandle *hello_pipe_stdin; |
44 | /* Pipe to read from started processes stdout (on read end) */ | 44 | /* Pipe to read from started processes stdout (on read end) */ |
@@ -50,11 +50,13 @@ static void | |||
50 | end_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 50 | end_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) |
51 | { | 51 | { |
52 | 52 | ||
53 | if (0 != PLIBC_KILL (pid, SIGTERM)) | 53 | if (0 != GNUNET_OS_process_kill (proc, SIGTERM)) |
54 | { | 54 | { |
55 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill"); | 55 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill"); |
56 | } | 56 | } |
57 | GNUNET_OS_process_wait (pid); | 57 | GNUNET_OS_process_wait (proc); |
58 | GNUNET_OS_process_close (proc); | ||
59 | proc = NULL; | ||
58 | GNUNET_DISK_pipe_close(hello_pipe_stdout); | 60 | GNUNET_DISK_pipe_close(hello_pipe_stdout); |
59 | GNUNET_DISK_pipe_close(hello_pipe_stdin); | 61 | GNUNET_DISK_pipe_close(hello_pipe_stdin); |
60 | } | 62 | } |
@@ -119,7 +121,7 @@ task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
119 | return; | 121 | return; |
120 | } | 122 | } |
121 | 123 | ||
122 | pid = GNUNET_OS_start_process (hello_pipe_stdin, hello_pipe_stdout, fn, | 124 | proc = GNUNET_OS_start_process (hello_pipe_stdin, hello_pipe_stdout, fn, |
123 | "test_gnunet_echo_hello", "-", NULL); | 125 | "test_gnunet_echo_hello", "-", NULL); |
124 | GNUNET_free (fn); | 126 | GNUNET_free (fn); |
125 | 127 | ||