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/core/test_core_api.c | |
parent | 37ac1b7c9e9e05f93d4100cfb53450ec2d370989 (diff) | |
download | gnunet-721e49caeea6ba5073f8bc5c6c08359295c02bb5.tar.gz gnunet-721e49caeea6ba5073f8bc5c6c08359295c02bb5.zip |
original patch from Mantis 1614
Diffstat (limited to 'src/core/test_core_api.c')
-rw-r--r-- | src/core/test_core_api.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/core/test_core_api.c b/src/core/test_core_api.c index b04430eea..a4c3b0a78 100644 --- a/src/core/test_core_api.c +++ b/src/core/test_core_api.c | |||
@@ -54,7 +54,7 @@ struct PeerContext | |||
54 | struct GNUNET_MessageHeader *hello; | 54 | struct GNUNET_MessageHeader *hello; |
55 | int connect_status; | 55 | int connect_status; |
56 | #if START_ARM | 56 | #if START_ARM |
57 | pid_t arm_pid; | 57 | GNUNET_OS_Process *arm_proc; |
58 | #endif | 58 | #endif |
59 | }; | 59 | }; |
60 | 60 | ||
@@ -289,7 +289,7 @@ setup_peer (struct PeerContext *p, const char *cfgname) | |||
289 | { | 289 | { |
290 | p->cfg = GNUNET_CONFIGURATION_create (); | 290 | p->cfg = GNUNET_CONFIGURATION_create (); |
291 | #if START_ARM | 291 | #if START_ARM |
292 | p->arm_pid = GNUNET_OS_start_process (NULL, NULL, "gnunet-service-arm", | 292 | p->arm_proc = GNUNET_OS_start_process (NULL, NULL, "gnunet-service-arm", |
293 | "gnunet-service-arm", | 293 | "gnunet-service-arm", |
294 | #if VERBOSE | 294 | #if VERBOSE |
295 | "-L", "DEBUG", | 295 | "-L", "DEBUG", |
@@ -332,12 +332,14 @@ static void | |||
332 | stop_arm (struct PeerContext *p) | 332 | stop_arm (struct PeerContext *p) |
333 | { | 333 | { |
334 | #if START_ARM | 334 | #if START_ARM |
335 | if (0 != PLIBC_KILL (p->arm_pid, SIGTERM)) | 335 | if (0 != GNUNET_OS_process_kill (p->arm_proc, SIGTERM)) |
336 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill"); | 336 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill"); |
337 | if (GNUNET_OS_process_wait(p->arm_pid) != GNUNET_OK) | 337 | if (GNUNET_OS_process_wait(p->arm_proc) != GNUNET_OK) |
338 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "waitpid"); | 338 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "waitpid"); |
339 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 339 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
340 | "ARM process %u stopped\n", p->arm_pid); | 340 | "ARM process %u stopped\n", GNUNET_OS_process_get_pid (p->arm_pid)); |
341 | GNUNET_OS_process_close (p->arm_proc); | ||
342 | p->arm_proc = NULL; | ||
341 | #endif | 343 | #endif |
342 | GNUNET_CONFIGURATION_destroy (p->cfg); | 344 | GNUNET_CONFIGURATION_destroy (p->cfg); |
343 | } | 345 | } |