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/hostlist/test_gnunet_daemon_hostlist.c | |
parent | 37ac1b7c9e9e05f93d4100cfb53450ec2d370989 (diff) | |
download | gnunet-721e49caeea6ba5073f8bc5c6c08359295c02bb5.tar.gz gnunet-721e49caeea6ba5073f8bc5c6c08359295c02bb5.zip |
original patch from Mantis 1614
Diffstat (limited to 'src/hostlist/test_gnunet_daemon_hostlist.c')
-rw-r--r-- | src/hostlist/test_gnunet_daemon_hostlist.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/hostlist/test_gnunet_daemon_hostlist.c b/src/hostlist/test_gnunet_daemon_hostlist.c index 899a2eb44..a13f58a65 100644 --- a/src/hostlist/test_gnunet_daemon_hostlist.c +++ b/src/hostlist/test_gnunet_daemon_hostlist.c | |||
@@ -49,7 +49,7 @@ struct PeerContext | |||
49 | struct GNUNET_TRANSPORT_Handle *th; | 49 | struct GNUNET_TRANSPORT_Handle *th; |
50 | struct GNUNET_MessageHeader *hello; | 50 | struct GNUNET_MessageHeader *hello; |
51 | #if START_ARM | 51 | #if START_ARM |
52 | pid_t arm_pid; | 52 | GNUNET_OS_Process *arm_proc; |
53 | #endif | 53 | #endif |
54 | }; | 54 | }; |
55 | 55 | ||
@@ -135,7 +135,7 @@ setup_peer (struct PeerContext *p, const char *cfgname) | |||
135 | { | 135 | { |
136 | p->cfg = GNUNET_CONFIGURATION_create (); | 136 | p->cfg = GNUNET_CONFIGURATION_create (); |
137 | #if START_ARM | 137 | #if START_ARM |
138 | p->arm_pid = GNUNET_OS_start_process (NULL, NULL, "gnunet-service-arm", | 138 | p->arm_proc = GNUNET_OS_start_process (NULL, NULL, "gnunet-service-arm", |
139 | "gnunet-service-arm", | 139 | "gnunet-service-arm", |
140 | #if VERBOSE | 140 | #if VERBOSE |
141 | "-L", "DEBUG", | 141 | "-L", "DEBUG", |
@@ -159,12 +159,14 @@ waitpid_task (void *cls, | |||
159 | #if START_ARM | 159 | #if START_ARM |
160 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 160 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
161 | "Killing ARM process.\n"); | 161 | "Killing ARM process.\n"); |
162 | if (0 != PLIBC_KILL (p->arm_pid, SIGTERM)) | 162 | if (0 != GNUNET_OS_process_kill (p->arm_proc, SIGTERM)) |
163 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill"); | 163 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill"); |
164 | if (GNUNET_OS_process_wait(p->arm_pid) != GNUNET_OK) | 164 | if (GNUNET_OS_process_wait(p->arm_proc) != GNUNET_OK) |
165 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "waitpid"); | 165 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "waitpid"); |
166 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 166 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
167 | "ARM process %u stopped\n", p->arm_pid); | 167 | "ARM process %u stopped\n", GNUNET_OS_process_get_pid (p->arm_proc)); |
168 | GNUNET_OS_process_close (p->arm_proc); | ||
169 | p->arm_proc = NULL; | ||
168 | #endif | 170 | #endif |
169 | GNUNET_CONFIGURATION_destroy (p->cfg); | 171 | GNUNET_CONFIGURATION_destroy (p->cfg); |
170 | } | 172 | } |