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_reliability.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_reliability.c')
-rw-r--r-- | src/core/test_core_api_reliability.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/core/test_core_api_reliability.c b/src/core/test_core_api_reliability.c index b25cb89f2..0b3be2f82 100644 --- a/src/core/test_core_api_reliability.c +++ b/src/core/test_core_api_reliability.c | |||
@@ -74,7 +74,7 @@ struct PeerContext | |||
74 | struct GNUNET_MessageHeader *hello; | 74 | struct GNUNET_MessageHeader *hello; |
75 | int connect_status; | 75 | int connect_status; |
76 | #if START_ARM | 76 | #if START_ARM |
77 | pid_t arm_pid; | 77 | GNUNET_OS_Process *arm_proc; |
78 | #endif | 78 | #endif |
79 | }; | 79 | }; |
80 | 80 | ||
@@ -436,7 +436,7 @@ setup_peer (struct PeerContext *p, const char *cfgname) | |||
436 | { | 436 | { |
437 | p->cfg = GNUNET_CONFIGURATION_create (); | 437 | p->cfg = GNUNET_CONFIGURATION_create (); |
438 | #if START_ARM | 438 | #if START_ARM |
439 | p->arm_pid = GNUNET_OS_start_process (NULL, NULL, "gnunet-service-arm", | 439 | p->arm_proc = GNUNET_OS_start_process (NULL, NULL, "gnunet-service-arm", |
440 | "gnunet-service-arm", | 440 | "gnunet-service-arm", |
441 | #if VERBOSE | 441 | #if VERBOSE |
442 | "-L", "DEBUG", | 442 | "-L", "DEBUG", |
@@ -479,12 +479,14 @@ static void | |||
479 | stop_arm (struct PeerContext *p) | 479 | stop_arm (struct PeerContext *p) |
480 | { | 480 | { |
481 | #if START_ARM | 481 | #if START_ARM |
482 | if (0 != PLIBC_KILL (p->arm_pid, SIGTERM)) | 482 | if (0 != GNUNET_OS_process_kill (p->arm_proc, SIGTERM)) |
483 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill"); | 483 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill"); |
484 | if (GNUNET_OS_process_wait(p->arm_pid) != GNUNET_OK) | 484 | if (GNUNET_OS_process_wait(p->arm_proc) != GNUNET_OK) |
485 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "waitpid"); | 485 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "waitpid"); |
486 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 486 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
487 | "ARM process %u stopped\n", p->arm_pid); | 487 | "ARM process %u stopped\n", GNUNET_OS_process_get_pid (p->arm_proc)); |
488 | GNUNET_OS_process_close (p->arm_proc); | ||
489 | p->arm_proc = NULL; | ||
488 | #endif | 490 | #endif |
489 | GNUNET_CONFIGURATION_destroy (p->cfg); | 491 | GNUNET_CONFIGURATION_destroy (p->cfg); |
490 | } | 492 | } |