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_learning.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_learning.c')
-rw-r--r-- | src/hostlist/test_gnunet_daemon_hostlist_learning.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/src/hostlist/test_gnunet_daemon_hostlist_learning.c b/src/hostlist/test_gnunet_daemon_hostlist_learning.c index 7fd291375..b5e6ca0bf 100644 --- a/src/hostlist/test_gnunet_daemon_hostlist_learning.c +++ b/src/hostlist/test_gnunet_daemon_hostlist_learning.c | |||
@@ -71,7 +71,7 @@ struct PeerContext | |||
71 | struct GNUNET_CORE_Handle *core; | 71 | struct GNUNET_CORE_Handle *core; |
72 | struct GNUNET_STATISTICS_Handle *stats; | 72 | struct GNUNET_STATISTICS_Handle *stats; |
73 | #if START_ARM | 73 | #if START_ARM |
74 | pid_t arm_pid; | 74 | GNUNET_OS_Process *arm_proc; |
75 | #endif | 75 | #endif |
76 | }; | 76 | }; |
77 | 77 | ||
@@ -144,24 +144,28 @@ static void shutdown_testcase() | |||
144 | #if START_ARM | 144 | #if START_ARM |
145 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 145 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
146 | "Killing hostlist server ARM process.\n"); | 146 | "Killing hostlist server ARM process.\n"); |
147 | if (0 != PLIBC_KILL (adv_peer.arm_pid, SIGTERM)) | 147 | if (0 != GNUNET_OS_process_kill (adv_peer.arm_proc, SIGTERM)) |
148 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill"); | 148 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill"); |
149 | if (GNUNET_OS_process_wait(adv_peer.arm_pid) != GNUNET_OK) | 149 | if (GNUNET_OS_process_wait(adv_peer.arm_proc) != GNUNET_OK) |
150 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "waitpid"); | 150 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "waitpid"); |
151 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 151 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
152 | "Hostlist server ARM process %u stopped\n", adv_peer.arm_pid); | 152 | "Hostlist server ARM process %u stopped\n", GNUNET_OS_process_get_pid (adv_peer.arm_proc)); |
153 | GNUNET_OS_process_close (adv_peer->arm_proc); | ||
154 | adv_peer->arm_proc = NULL; | ||
153 | #endif | 155 | #endif |
154 | 156 | ||
155 | 157 | ||
156 | #if START_ARM | 158 | #if START_ARM |
157 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 159 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
158 | "Killing hostlist client ARM process.\n"); | 160 | "Killing hostlist client ARM process.\n"); |
159 | if (0 != PLIBC_KILL (learn_peer.arm_pid, SIGTERM)) | 161 | if (0 != GNUNET_OS_process_kill (learn_peer.arm_proc, SIGTERM)) |
160 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill"); | 162 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill"); |
161 | if (GNUNET_OS_process_wait(learn_peer.arm_pid) != GNUNET_OK) | 163 | if (GNUNET_OS_process_wait(learn_peer.arm_proc) != GNUNET_OK) |
162 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "waitpid"); | 164 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "waitpid"); |
163 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 165 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
164 | "Hostlist client ARM process %u stopped\n", learn_peer.arm_pid); | 166 | "Hostlist client ARM process %u stopped\n", GNUNET_OS_process_get_pid (learn_peer.arm_proc)); |
167 | GNUNET_OS_process_close (learn_peer->arm_proc); | ||
168 | learn_peer->arm_proc = NULL; | ||
165 | #endif | 169 | #endif |
166 | 170 | ||
167 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Shutting down scheduler\n"); | 171 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Shutting down scheduler\n"); |
@@ -354,7 +358,7 @@ setup_learn_peer (struct PeerContext *p, const char *cfgname) | |||
354 | unsigned int result; | 358 | unsigned int result; |
355 | p->cfg = GNUNET_CONFIGURATION_create (); | 359 | p->cfg = GNUNET_CONFIGURATION_create (); |
356 | #if START_ARM | 360 | #if START_ARM |
357 | p->arm_pid = GNUNET_OS_start_process (NULL, NULL, "gnunet-service-arm", | 361 | p->arm_proc = GNUNET_OS_start_process (NULL, NULL, "gnunet-service-arm", |
358 | "gnunet-service-arm", | 362 | "gnunet-service-arm", |
359 | #if VERBOSE | 363 | #if VERBOSE |
360 | "-L", "DEBUG", | 364 | "-L", "DEBUG", |
@@ -397,7 +401,7 @@ setup_adv_peer (struct PeerContext *p, const char *cfgname) | |||
397 | 401 | ||
398 | p->cfg = GNUNET_CONFIGURATION_create (); | 402 | p->cfg = GNUNET_CONFIGURATION_create (); |
399 | #if START_ARM | 403 | #if START_ARM |
400 | p->arm_pid = GNUNET_OS_start_process (NULL, NULL, "gnunet-service-arm", | 404 | p->arm_proc = GNUNET_OS_start_process (NULL, NULL, "gnunet-service-arm", |
401 | "gnunet-service-arm", | 405 | "gnunet-service-arm", |
402 | #if VERBOSE | 406 | #if VERBOSE |
403 | "-L", "DEBUG", | 407 | "-L", "DEBUG", |