From 721e49caeea6ba5073f8bc5c6c08359295c02bb5 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Wed, 3 Nov 2010 21:26:40 +0000 Subject: original patch from Mantis 1614 --- src/fs/test_fs_unindex.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/fs/test_fs_unindex.c') diff --git a/src/fs/test_fs_unindex.c b/src/fs/test_fs_unindex.c index 6fe47a6c4..0afed8f06 100644 --- a/src/fs/test_fs_unindex.c +++ b/src/fs/test_fs_unindex.c @@ -52,7 +52,7 @@ struct PeerContext { struct GNUNET_CONFIGURATION_Handle *cfg; #if START_ARM - pid_t arm_pid; + GNUNET_OS_Process *arm_proc; #endif }; @@ -196,7 +196,7 @@ setup_peer (struct PeerContext *p, const char *cfgname) { p->cfg = GNUNET_CONFIGURATION_create (); #if START_ARM - p->arm_pid = GNUNET_OS_start_process (NULL, NULL, "gnunet-service-arm", + p->arm_proc = GNUNET_OS_start_process (NULL, NULL, "gnunet-service-arm", "gnunet-service-arm", #if VERBOSE "-L", "DEBUG", @@ -211,12 +211,14 @@ static void stop_arm (struct PeerContext *p) { #if START_ARM - if (0 != PLIBC_KILL (p->arm_pid, SIGTERM)) + if (0 != GNUNET_OS_process_kill (p->arm_proc, SIGTERM)) GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill"); - if (GNUNET_OS_process_wait(p->arm_pid) != GNUNET_OK) + if (GNUNET_OS_process_wait(p->arm_proc) != GNUNET_OK) GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "waitpid"); GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, - "ARM process %u stopped\n", p->arm_pid); + "ARM process %u stopped\n", GNUNET_OS_process_get_pid (p->arm_proc)); + GNUNET_OS_process_close (p->arm_proc); + p->arm_proc = NULL; #endif GNUNET_CONFIGURATION_destroy (p->cfg); } -- cgit v1.2.3