aboutsummaryrefslogtreecommitdiff
path: root/src/util/test_os_start_process.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2010-11-03 21:26:40 +0000
committerChristian Grothoff <christian@grothoff.org>2010-11-03 21:26:40 +0000
commit721e49caeea6ba5073f8bc5c6c08359295c02bb5 (patch)
treee06e80ba90af91e9452a48a7a5782913199b4877 /src/util/test_os_start_process.c
parent37ac1b7c9e9e05f93d4100cfb53450ec2d370989 (diff)
downloadgnunet-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.c10
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 @@
38static char *test_phrase = "HELLO WORLD"; 38static char *test_phrase = "HELLO WORLD";
39static int ok; 39static int ok;
40 40
41static pid_t pid; 41static 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) */
43static struct GNUNET_DISK_PipeHandle *hello_pipe_stdin; 43static 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
50end_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 50end_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