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_start_only.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_start_only.c')
-rw-r--r-- | src/core/test_core_api_start_only.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/core/test_core_api_start_only.c b/src/core/test_core_api_start_only.c index b55d3c972..e82f12ed3 100644 --- a/src/core/test_core_api_start_only.c +++ b/src/core/test_core_api_start_only.c | |||
@@ -49,7 +49,7 @@ struct PeerContext | |||
49 | struct GNUNET_CORE_Handle *ch; | 49 | struct GNUNET_CORE_Handle *ch; |
50 | struct GNUNET_PeerIdentity id; | 50 | struct GNUNET_PeerIdentity id; |
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 | ||
@@ -153,7 +153,7 @@ setup_peer (struct PeerContext *p, const char *cfgname) | |||
153 | { | 153 | { |
154 | p->cfg = GNUNET_CONFIGURATION_create (); | 154 | p->cfg = GNUNET_CONFIGURATION_create (); |
155 | #if START_ARM | 155 | #if START_ARM |
156 | p->arm_pid = GNUNET_OS_start_process (NULL, NULL, "gnunet-service-arm", | 156 | p->arm_proc = GNUNET_OS_start_process (NULL, NULL, "gnunet-service-arm", |
157 | "gnunet-service-arm", | 157 | "gnunet-service-arm", |
158 | #if VERBOSE | 158 | #if VERBOSE |
159 | "-L", "DEBUG", | 159 | "-L", "DEBUG", |
@@ -193,12 +193,14 @@ static void | |||
193 | stop_arm (struct PeerContext *p) | 193 | stop_arm (struct PeerContext *p) |
194 | { | 194 | { |
195 | #if START_ARM | 195 | #if START_ARM |
196 | if (0 != PLIBC_KILL (p->arm_pid, SIGTERM)) | 196 | if (0 != GNUNET_OS_process_kill (p->arm_proc, SIGTERM)) |
197 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill"); | 197 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill"); |
198 | if (GNUNET_OS_process_wait(p->arm_pid) != GNUNET_OK) | 198 | if (GNUNET_OS_process_wait(p->arm_proc) != GNUNET_OK) |
199 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "waitpid"); | 199 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "waitpid"); |
200 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 200 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
201 | "ARM process %u stopped\n", p->arm_pid); | 201 | "ARM process %u stopped\n", GNUNET_OS_process_get_pid (p->arm_proc)); |
202 | GNUNET_OS_process_close (p->arm_proc); | ||
203 | p->arm_proc = NULL; | ||
202 | #endif | 204 | #endif |
203 | GNUNET_CONFIGURATION_destroy (p->cfg); | 205 | GNUNET_CONFIGURATION_destroy (p->cfg); |
204 | } | 206 | } |