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/fs | |
parent | 37ac1b7c9e9e05f93d4100cfb53450ec2d370989 (diff) | |
download | gnunet-721e49caeea6ba5073f8bc5c6c08359295c02bb5.tar.gz gnunet-721e49caeea6ba5073f8bc5c6c08359295c02bb5.zip |
original patch from Mantis 1614
Diffstat (limited to 'src/fs')
-rw-r--r-- | src/fs/test_fs.c | 5 | ||||
-rw-r--r-- | src/fs/test_fs_download.c | 12 | ||||
-rw-r--r-- | src/fs/test_fs_download_indexed.c | 12 | ||||
-rw-r--r-- | src/fs/test_fs_download_persistence.c | 12 | ||||
-rw-r--r-- | src/fs/test_fs_download_recursive.c | 8 | ||||
-rw-r--r-- | src/fs/test_fs_list_indexed.c | 12 | ||||
-rw-r--r-- | src/fs/test_fs_namespace.c | 12 | ||||
-rw-r--r-- | src/fs/test_fs_namespace_list_updateable.c | 12 | ||||
-rw-r--r-- | src/fs/test_fs_publish.c | 12 | ||||
-rw-r--r-- | src/fs/test_fs_publish_persistence.c | 12 | ||||
-rw-r--r-- | src/fs/test_fs_search.c | 12 | ||||
-rw-r--r-- | src/fs/test_fs_search_persistence.c | 12 | ||||
-rw-r--r-- | src/fs/test_fs_search_ranking.c | 6 | ||||
-rw-r--r-- | src/fs/test_fs_start_stop.c | 12 | ||||
-rw-r--r-- | src/fs/test_fs_unindex.c | 12 | ||||
-rw-r--r-- | src/fs/test_fs_unindex_persistence.c | 12 |
16 files changed, 103 insertions, 72 deletions
diff --git a/src/fs/test_fs.c b/src/fs/test_fs.c index f9621949e..a97faf94f 100644 --- a/src/fs/test_fs.c +++ b/src/fs/test_fs.c | |||
@@ -104,7 +104,7 @@ int | |||
104 | main (int argc, char *argv[]) | 104 | main (int argc, char *argv[]) |
105 | { | 105 | { |
106 | #if START_DAEMON | 106 | #if START_DAEMON |
107 | pid_t daemon; | 107 | GNUNET_OS_Process *daemon; |
108 | #endif | 108 | #endif |
109 | int ok; | 109 | int ok; |
110 | struct GNUNET_ECRS_URI *uri; | 110 | struct GNUNET_ECRS_URI *uri; |
@@ -132,7 +132,7 @@ main (int argc, char *argv[]) | |||
132 | } | 132 | } |
133 | #if START_DAEMON | 133 | #if START_DAEMON |
134 | daemon = GNUNET_daemon_start (NULL, cfg, "peer.conf", GNUNET_NO); | 134 | daemon = GNUNET_daemon_start (NULL, cfg, "peer.conf", GNUNET_NO); |
135 | GNUNET_GE_ASSERT (NULL, daemon > 0); | 135 | GNUNET_GE_ASSERT (NULL, daemon != NULL); |
136 | CHECK (GNUNET_OK == | 136 | CHECK (GNUNET_OK == |
137 | GNUNET_wait_for_daemon_running (NULL, cfg, | 137 | GNUNET_wait_for_daemon_running (NULL, cfg, |
138 | 60 * GNUNET_CRON_SECONDS)); | 138 | 60 * GNUNET_CRON_SECONDS)); |
@@ -250,6 +250,7 @@ FAILURE: | |||
250 | 250 | ||
251 | #if START_DAEMON | 251 | #if START_DAEMON |
252 | GNUNET_GE_ASSERT (NULL, GNUNET_OK == GNUNET_daemon_stop (NULL, daemon)); | 252 | GNUNET_GE_ASSERT (NULL, GNUNET_OK == GNUNET_daemon_stop (NULL, daemon)); |
253 | GNUNET_OS_process_close (daemon); | ||
253 | #endif | 254 | #endif |
254 | GNUNET_GC_free (cfg); | 255 | GNUNET_GC_free (cfg); |
255 | 256 | ||
diff --git a/src/fs/test_fs_download.c b/src/fs/test_fs_download.c index 848c95954..305dee07e 100644 --- a/src/fs/test_fs_download.c +++ b/src/fs/test_fs_download.c | |||
@@ -52,7 +52,7 @@ struct PeerContext | |||
52 | { | 52 | { |
53 | struct GNUNET_CONFIGURATION_Handle *cfg; | 53 | struct GNUNET_CONFIGURATION_Handle *cfg; |
54 | #if START_ARM | 54 | #if START_ARM |
55 | pid_t arm_pid; | 55 | GNUNET_OS_Process *arm_proc; |
56 | #endif | 56 | #endif |
57 | }; | 57 | }; |
58 | 58 | ||
@@ -249,7 +249,7 @@ setup_peer (struct PeerContext *p, const char *cfgname) | |||
249 | { | 249 | { |
250 | p->cfg = GNUNET_CONFIGURATION_create (); | 250 | p->cfg = GNUNET_CONFIGURATION_create (); |
251 | #if START_ARM | 251 | #if START_ARM |
252 | p->arm_pid = GNUNET_OS_start_process (NULL, NULL, "gnunet-service-arm", | 252 | p->arm_proc = GNUNET_OS_start_process (NULL, NULL, "gnunet-service-arm", |
253 | "gnunet-service-arm", | 253 | "gnunet-service-arm", |
254 | #if VERBOSE | 254 | #if VERBOSE |
255 | "-L", "DEBUG", | 255 | "-L", "DEBUG", |
@@ -264,12 +264,14 @@ static void | |||
264 | stop_arm (struct PeerContext *p) | 264 | stop_arm (struct PeerContext *p) |
265 | { | 265 | { |
266 | #if START_ARM | 266 | #if START_ARM |
267 | if (0 != PLIBC_KILL (p->arm_pid, SIGTERM)) | 267 | if (0 != GNUNET_OS_process_kill (p->arm_proc, SIGTERM)) |
268 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill"); | 268 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill"); |
269 | if (GNUNET_OS_process_wait(p->arm_pid) != GNUNET_OK) | 269 | if (GNUNET_OS_process_wait(p->arm_proc) != GNUNET_OK) |
270 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "waitpid"); | 270 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "waitpid"); |
271 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 271 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
272 | "ARM process %u stopped\n", p->arm_pid); | 272 | "ARM process %u stopped\n", GNUNET_OS_process_get_pid (p->arm_proc)); |
273 | GNUNET_OS_process_close (p->arm_proc); | ||
274 | p->arm_proc = NULL; | ||
273 | #endif | 275 | #endif |
274 | GNUNET_CONFIGURATION_destroy (p->cfg); | 276 | GNUNET_CONFIGURATION_destroy (p->cfg); |
275 | } | 277 | } |
diff --git a/src/fs/test_fs_download_indexed.c b/src/fs/test_fs_download_indexed.c index ac4f57bb9..b55f2221b 100644 --- a/src/fs/test_fs_download_indexed.c +++ b/src/fs/test_fs_download_indexed.c | |||
@@ -52,7 +52,7 @@ struct PeerContext | |||
52 | { | 52 | { |
53 | struct GNUNET_CONFIGURATION_Handle *cfg; | 53 | struct GNUNET_CONFIGURATION_Handle *cfg; |
54 | #if START_ARM | 54 | #if START_ARM |
55 | pid_t arm_pid; | 55 | GNUNET_OS_Process *arm_proc; |
56 | #endif | 56 | #endif |
57 | }; | 57 | }; |
58 | 58 | ||
@@ -251,7 +251,7 @@ setup_peer (struct PeerContext *p, const char *cfgname) | |||
251 | { | 251 | { |
252 | p->cfg = GNUNET_CONFIGURATION_create (); | 252 | p->cfg = GNUNET_CONFIGURATION_create (); |
253 | #if START_ARM | 253 | #if START_ARM |
254 | p->arm_pid = GNUNET_OS_start_process (NULL, NULL, "gnunet-service-arm", | 254 | p->arm_proc = GNUNET_OS_start_process (NULL, NULL, "gnunet-service-arm", |
255 | "gnunet-service-arm", | 255 | "gnunet-service-arm", |
256 | #if VERBOSE | 256 | #if VERBOSE |
257 | "-L", "DEBUG", | 257 | "-L", "DEBUG", |
@@ -266,12 +266,14 @@ static void | |||
266 | stop_arm (struct PeerContext *p) | 266 | stop_arm (struct PeerContext *p) |
267 | { | 267 | { |
268 | #if START_ARM | 268 | #if START_ARM |
269 | if (0 != PLIBC_KILL (p->arm_pid, SIGTERM)) | 269 | if (0 != GNUNET_OS_process_kill (p->arm_proc, SIGTERM)) |
270 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill"); | 270 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill"); |
271 | if (GNUNET_OS_process_wait(p->arm_pid) != GNUNET_OK) | 271 | if (GNUNET_OS_process_wait(p->arm_proc) != GNUNET_OK) |
272 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "waitpid"); | 272 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "waitpid"); |
273 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 273 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
274 | "ARM process %u stopped\n", p->arm_pid); | 274 | "ARM process %u stopped\n", GNUNET_OS_process_get_pid (p->arm_proc)); |
275 | GNUNET_OS_process_close (p->arm_proc); | ||
276 | p->arm_proc = NULL; | ||
275 | #endif | 277 | #endif |
276 | GNUNET_CONFIGURATION_destroy (p->cfg); | 278 | GNUNET_CONFIGURATION_destroy (p->cfg); |
277 | } | 279 | } |
diff --git a/src/fs/test_fs_download_persistence.c b/src/fs/test_fs_download_persistence.c index 4560985c9..6bb4ab865 100644 --- a/src/fs/test_fs_download_persistence.c +++ b/src/fs/test_fs_download_persistence.c | |||
@@ -52,7 +52,7 @@ struct PeerContext | |||
52 | { | 52 | { |
53 | struct GNUNET_CONFIGURATION_Handle *cfg; | 53 | struct GNUNET_CONFIGURATION_Handle *cfg; |
54 | #if START_ARM | 54 | #if START_ARM |
55 | pid_t arm_pid; | 55 | GNUNET_OS_Process *arm_proc; |
56 | #endif | 56 | #endif |
57 | }; | 57 | }; |
58 | 58 | ||
@@ -310,7 +310,7 @@ setup_peer (struct PeerContext *p, const char *cfgname) | |||
310 | { | 310 | { |
311 | p->cfg = GNUNET_CONFIGURATION_create (); | 311 | p->cfg = GNUNET_CONFIGURATION_create (); |
312 | #if START_ARM | 312 | #if START_ARM |
313 | p->arm_pid = GNUNET_OS_start_process (NULL, NULL, "gnunet-service-arm", | 313 | p->arm_proc = GNUNET_OS_start_process (NULL, NULL, "gnunet-service-arm", |
314 | "gnunet-service-arm", | 314 | "gnunet-service-arm", |
315 | #if VERBOSE | 315 | #if VERBOSE |
316 | "-L", "DEBUG", | 316 | "-L", "DEBUG", |
@@ -325,12 +325,14 @@ static void | |||
325 | stop_arm (struct PeerContext *p) | 325 | stop_arm (struct PeerContext *p) |
326 | { | 326 | { |
327 | #if START_ARM | 327 | #if START_ARM |
328 | if (0 != PLIBC_KILL (p->arm_pid, SIGTERM)) | 328 | if (0 != GNUNET_OS_process_kill (p->arm_proc, SIGTERM)) |
329 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill"); | 329 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill"); |
330 | if (GNUNET_OS_process_wait(p->arm_pid) != GNUNET_OK) | 330 | if (GNUNET_OS_process_wait(p->arm_proc) != GNUNET_OK) |
331 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "waitpid"); | 331 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "waitpid"); |
332 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 332 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
333 | "ARM process %u stopped\n", p->arm_pid); | 333 | "ARM process %u stopped\n", GNUNET_OS_process_get_pid (p->arm_proc)); |
334 | GNUNET_OS_process_close (p->arm_proc); | ||
335 | p->arm_proc = NULL; | ||
334 | #endif | 336 | #endif |
335 | GNUNET_CONFIGURATION_destroy (p->cfg); | 337 | GNUNET_CONFIGURATION_destroy (p->cfg); |
336 | } | 338 | } |
diff --git a/src/fs/test_fs_download_recursive.c b/src/fs/test_fs_download_recursive.c index 20f681f11..a60a2da9a 100644 --- a/src/fs/test_fs_download_recursive.c +++ b/src/fs/test_fs_download_recursive.c | |||
@@ -29,7 +29,7 @@ | |||
29 | #include "gnunet_util.h" | 29 | #include "gnunet_util.h" |
30 | #include "gnunet_fsui_lib.h" | 30 | #include "gnunet_fsui_lib.h" |
31 | 31 | ||
32 | #define DEBUG_VERBOSE GNUNET_NO | 32 | #define DEBUG_VERBOSE GNUNET_YES |
33 | 33 | ||
34 | #define CHECK(a) if (!(a)) { ok = GNUNET_NO; GNUNET_GE_BREAK(ectx, 0); goto FAILURE; } | 34 | #define CHECK(a) if (!(a)) { ok = GNUNET_NO; GNUNET_GE_BREAK(ectx, 0); goto FAILURE; } |
35 | 35 | ||
@@ -256,7 +256,7 @@ int | |||
256 | main (int argc, char *argv[]) | 256 | main (int argc, char *argv[]) |
257 | { | 257 | { |
258 | #if START_DAEMON | 258 | #if START_DAEMON |
259 | pid_t daemon; | 259 | GNUNET_OS_Process *daemon; |
260 | #endif | 260 | #endif |
261 | int ok; | 261 | int ok; |
262 | char *fn = NULL; | 262 | char *fn = NULL; |
@@ -284,7 +284,7 @@ main (int argc, char *argv[]) | |||
284 | GNUNET_disk_directory_remove (NULL, | 284 | GNUNET_disk_directory_remove (NULL, |
285 | "/tmp/gnunet-fsui-recursive_download_test/"); | 285 | "/tmp/gnunet-fsui-recursive_download_test/"); |
286 | daemon = GNUNET_daemon_start (NULL, cfg, "peer.conf", GNUNET_NO); | 286 | daemon = GNUNET_daemon_start (NULL, cfg, "peer.conf", GNUNET_NO); |
287 | GNUNET_GE_ASSERT (NULL, daemon > 0); | 287 | GNUNET_GE_ASSERT (NULL, daemon != NULL); |
288 | CHECK (GNUNET_OK == | 288 | CHECK (GNUNET_OK == |
289 | GNUNET_wait_for_daemon_running (NULL, cfg, | 289 | GNUNET_wait_for_daemon_running (NULL, cfg, |
290 | 30 * GNUNET_CRON_SECONDS)); | 290 | 30 * GNUNET_CRON_SECONDS)); |
@@ -372,6 +372,8 @@ FAILURE: | |||
372 | 372 | ||
373 | #if START_DAEMON | 373 | #if START_DAEMON |
374 | GNUNET_GE_BREAK (NULL, GNUNET_OK == GNUNET_daemon_stop (NULL, daemon)); | 374 | GNUNET_GE_BREAK (NULL, GNUNET_OK == GNUNET_daemon_stop (NULL, daemon)); |
375 | GNUNET_OS_process_close (daemon); | ||
376 | daemon = NULL; | ||
375 | #endif | 377 | #endif |
376 | GNUNET_GC_free (cfg); | 378 | GNUNET_GC_free (cfg); |
377 | return (ok == GNUNET_YES) ? 0 : 1; | 379 | return (ok == GNUNET_YES) ? 0 : 1; |
diff --git a/src/fs/test_fs_list_indexed.c b/src/fs/test_fs_list_indexed.c index dd2b30417..1221ff6c4 100644 --- a/src/fs/test_fs_list_indexed.c +++ b/src/fs/test_fs_list_indexed.c | |||
@@ -56,7 +56,7 @@ struct PeerContext | |||
56 | { | 56 | { |
57 | struct GNUNET_CONFIGURATION_Handle *cfg; | 57 | struct GNUNET_CONFIGURATION_Handle *cfg; |
58 | #if START_ARM | 58 | #if START_ARM |
59 | pid_t arm_pid; | 59 | GNUNET_OS_Process *arm_proc; |
60 | #endif | 60 | #endif |
61 | }; | 61 | }; |
62 | 62 | ||
@@ -199,7 +199,7 @@ setup_peer (struct PeerContext *p, const char *cfgname) | |||
199 | { | 199 | { |
200 | p->cfg = GNUNET_CONFIGURATION_create (); | 200 | p->cfg = GNUNET_CONFIGURATION_create (); |
201 | #if START_ARM | 201 | #if START_ARM |
202 | p->arm_pid = GNUNET_OS_start_process (NULL, NULL, "gnunet-service-arm", | 202 | p->arm_proc = GNUNET_OS_start_process (NULL, NULL, "gnunet-service-arm", |
203 | "gnunet-service-arm", | 203 | "gnunet-service-arm", |
204 | #if VERBOSE | 204 | #if VERBOSE |
205 | "-L", "DEBUG", | 205 | "-L", "DEBUG", |
@@ -214,12 +214,14 @@ static void | |||
214 | stop_arm (struct PeerContext *p) | 214 | stop_arm (struct PeerContext *p) |
215 | { | 215 | { |
216 | #if START_ARM | 216 | #if START_ARM |
217 | if (0 != PLIBC_KILL (p->arm_pid, SIGTERM)) | 217 | if (0 != GNUNET_OS_process_kill (p->arm_proc, SIGTERM)) |
218 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill"); | 218 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill"); |
219 | if (GNUNET_OS_process_wait(p->arm_pid) != GNUNET_OK) | 219 | if (GNUNET_OS_process_wait(p->arm_proc) != GNUNET_OK) |
220 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "waitpid"); | 220 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "waitpid"); |
221 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 221 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
222 | "ARM process %u stopped\n", p->arm_pid); | 222 | "ARM process %u stopped\n", GNUNET_OS_process_get_pid (p->arm_proc)); |
223 | GNUNET_OS_process_close (p->arm_proc); | ||
224 | p->arm_proc = NULL; | ||
223 | #endif | 225 | #endif |
224 | GNUNET_CONFIGURATION_destroy (p->cfg); | 226 | GNUNET_CONFIGURATION_destroy (p->cfg); |
225 | } | 227 | } |
diff --git a/src/fs/test_fs_namespace.c b/src/fs/test_fs_namespace.c index f197b4749..efe44af0b 100644 --- a/src/fs/test_fs_namespace.c +++ b/src/fs/test_fs_namespace.c | |||
@@ -59,7 +59,7 @@ struct PeerContext | |||
59 | { | 59 | { |
60 | struct GNUNET_CONFIGURATION_Handle *cfg; | 60 | struct GNUNET_CONFIGURATION_Handle *cfg; |
61 | #if START_ARM | 61 | #if START_ARM |
62 | pid_t arm_pid; | 62 | GNUNET_OS_Process *arm_proc; |
63 | #endif | 63 | #endif |
64 | }; | 64 | }; |
65 | 65 | ||
@@ -69,7 +69,7 @@ setup_peer (struct PeerContext *p, const char *cfgname) | |||
69 | { | 69 | { |
70 | p->cfg = GNUNET_CONFIGURATION_create (); | 70 | p->cfg = GNUNET_CONFIGURATION_create (); |
71 | #if START_ARM | 71 | #if START_ARM |
72 | p->arm_pid = GNUNET_OS_start_process (NULL, NULL, "gnunet-service-arm", | 72 | p->arm_proc = GNUNET_OS_start_process (NULL, NULL, "gnunet-service-arm", |
73 | "gnunet-service-arm", | 73 | "gnunet-service-arm", |
74 | #if VERBOSE | 74 | #if VERBOSE |
75 | "-L", "DEBUG", | 75 | "-L", "DEBUG", |
@@ -84,12 +84,14 @@ static void | |||
84 | stop_arm (struct PeerContext *p) | 84 | stop_arm (struct PeerContext *p) |
85 | { | 85 | { |
86 | #if START_ARM | 86 | #if START_ARM |
87 | if (0 != PLIBC_KILL (p->arm_pid, SIGTERM)) | 87 | if (0 != GNUNET_OS_process_kill (p->arm_proc, SIGTERM)) |
88 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill"); | 88 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill"); |
89 | if (GNUNET_OS_process_wait(p->arm_pid) != GNUNET_OK) | 89 | if (GNUNET_OS_process_wait(p->arm_proc) != GNUNET_OK) |
90 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "waitpid"); | 90 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "waitpid"); |
91 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 91 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
92 | "ARM process %u stopped\n", p->arm_pid); | 92 | "ARM process %u stopped\n", GNUNET_OS_process_get_pid (p->arm_proc)); |
93 | GNUNET_OS_process_close (p->arm_proc); | ||
94 | p->arm_proc = NULL; | ||
93 | #endif | 95 | #endif |
94 | GNUNET_CONFIGURATION_destroy (p->cfg); | 96 | GNUNET_CONFIGURATION_destroy (p->cfg); |
95 | } | 97 | } |
diff --git a/src/fs/test_fs_namespace_list_updateable.c b/src/fs/test_fs_namespace_list_updateable.c index fc6b1537a..1cf8653bb 100644 --- a/src/fs/test_fs_namespace_list_updateable.c +++ b/src/fs/test_fs_namespace_list_updateable.c | |||
@@ -55,7 +55,7 @@ struct PeerContext | |||
55 | { | 55 | { |
56 | struct GNUNET_CONFIGURATION_Handle *cfg; | 56 | struct GNUNET_CONFIGURATION_Handle *cfg; |
57 | #if START_ARM | 57 | #if START_ARM |
58 | pid_t arm_pid; | 58 | GNUNET_OS_Process *arm_proc; |
59 | #endif | 59 | #endif |
60 | }; | 60 | }; |
61 | 61 | ||
@@ -73,7 +73,7 @@ setup_peer (struct PeerContext *p, const char *cfgname) | |||
73 | { | 73 | { |
74 | p->cfg = GNUNET_CONFIGURATION_create (); | 74 | p->cfg = GNUNET_CONFIGURATION_create (); |
75 | #if START_ARM | 75 | #if START_ARM |
76 | p->arm_pid = GNUNET_OS_start_process (NULL, NULL, "gnunet-service-arm", | 76 | p->arm_proc = GNUNET_OS_start_process (NULL, NULL, "gnunet-service-arm", |
77 | "gnunet-service-arm", | 77 | "gnunet-service-arm", |
78 | #if VERBOSE | 78 | #if VERBOSE |
79 | "-L", "DEBUG", | 79 | "-L", "DEBUG", |
@@ -88,12 +88,14 @@ static void | |||
88 | stop_arm (struct PeerContext *p) | 88 | stop_arm (struct PeerContext *p) |
89 | { | 89 | { |
90 | #if START_ARM | 90 | #if START_ARM |
91 | if (0 != PLIBC_KILL (p->arm_pid, SIGTERM)) | 91 | if (0 != GNUNET_OS_process_kill (p->arm_proc, SIGTERM)) |
92 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill"); | 92 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill"); |
93 | if (GNUNET_OS_process_wait(p->arm_pid) != GNUNET_OK) | 93 | if (GNUNET_OS_process_wait(p->arm_proc) != GNUNET_OK) |
94 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "waitpid"); | 94 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "waitpid"); |
95 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 95 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
96 | "ARM process %u stopped\n", p->arm_pid); | 96 | "ARM process %u stopped\n", GNUNET_OS_process_get_pid (p->arm_proc)); |
97 | GNUNET_OS_process_close (p->arm_proc); | ||
98 | p->arm_proc = NULL; | ||
97 | #endif | 99 | #endif |
98 | if (uri_this != NULL) | 100 | if (uri_this != NULL) |
99 | GNUNET_FS_uri_destroy (uri_this); | 101 | GNUNET_FS_uri_destroy (uri_this); |
diff --git a/src/fs/test_fs_publish.c b/src/fs/test_fs_publish.c index f5b835259..4e65e7590 100644 --- a/src/fs/test_fs_publish.c +++ b/src/fs/test_fs_publish.c | |||
@@ -53,7 +53,7 @@ struct PeerContext | |||
53 | { | 53 | { |
54 | struct GNUNET_CONFIGURATION_Handle *cfg; | 54 | struct GNUNET_CONFIGURATION_Handle *cfg; |
55 | #if START_ARM | 55 | #if START_ARM |
56 | pid_t arm_pid; | 56 | GNUNET_OS_Process *arm_proc; |
57 | #endif | 57 | #endif |
58 | }; | 58 | }; |
59 | 59 | ||
@@ -184,7 +184,7 @@ setup_peer (struct PeerContext *p, const char *cfgname) | |||
184 | { | 184 | { |
185 | p->cfg = GNUNET_CONFIGURATION_create (); | 185 | p->cfg = GNUNET_CONFIGURATION_create (); |
186 | #if START_ARM | 186 | #if START_ARM |
187 | p->arm_pid = GNUNET_OS_start_process (NULL, NULL, "gnunet-service-arm", | 187 | p->arm_proc = GNUNET_OS_start_process (NULL, NULL, "gnunet-service-arm", |
188 | "gnunet-service-arm", | 188 | "gnunet-service-arm", |
189 | #if VERBOSE | 189 | #if VERBOSE |
190 | "-L", "DEBUG", | 190 | "-L", "DEBUG", |
@@ -199,12 +199,14 @@ static void | |||
199 | stop_arm (struct PeerContext *p) | 199 | stop_arm (struct PeerContext *p) |
200 | { | 200 | { |
201 | #if START_ARM | 201 | #if START_ARM |
202 | if (0 != PLIBC_KILL (p->arm_pid, SIGTERM)) | 202 | if (0 != GNUNET_OS_process_kill (p->arm_proc, SIGTERM)) |
203 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill"); | 203 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill"); |
204 | if (GNUNET_OS_process_wait(p->arm_pid) != GNUNET_OK) | 204 | if (GNUNET_OS_process_wait(p->arm_proc) != GNUNET_OK) |
205 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "waitpid"); | 205 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "waitpid"); |
206 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 206 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
207 | "ARM process %u stopped\n", p->arm_pid); | 207 | "ARM process %u stopped\n", GNUNET_OS_process_get_pid (p->arm_proc)); |
208 | GNUNET_OS_process_close (p->arm_proc); | ||
209 | p->arm_proc = NULL; | ||
208 | #endif | 210 | #endif |
209 | GNUNET_CONFIGURATION_destroy (p->cfg); | 211 | GNUNET_CONFIGURATION_destroy (p->cfg); |
210 | } | 212 | } |
diff --git a/src/fs/test_fs_publish_persistence.c b/src/fs/test_fs_publish_persistence.c index b4b9b58ba..afbee2ec8 100644 --- a/src/fs/test_fs_publish_persistence.c +++ b/src/fs/test_fs_publish_persistence.c | |||
@@ -52,7 +52,7 @@ struct PeerContext | |||
52 | { | 52 | { |
53 | struct GNUNET_CONFIGURATION_Handle *cfg; | 53 | struct GNUNET_CONFIGURATION_Handle *cfg; |
54 | #if START_ARM | 54 | #if START_ARM |
55 | pid_t arm_pid; | 55 | GNUNET_OS_Process *arm_proc; |
56 | #endif | 56 | #endif |
57 | }; | 57 | }; |
58 | 58 | ||
@@ -243,7 +243,7 @@ setup_peer (struct PeerContext *p, const char *cfgname) | |||
243 | { | 243 | { |
244 | p->cfg = GNUNET_CONFIGURATION_create (); | 244 | p->cfg = GNUNET_CONFIGURATION_create (); |
245 | #if START_ARM | 245 | #if START_ARM |
246 | p->arm_pid = GNUNET_OS_start_process (NULL, NULL, "gnunet-service-arm", | 246 | p->arm_proc = GNUNET_OS_start_process (NULL, NULL, "gnunet-service-arm", |
247 | "gnunet-service-arm", | 247 | "gnunet-service-arm", |
248 | #if VERBOSE | 248 | #if VERBOSE |
249 | "-L", "DEBUG", | 249 | "-L", "DEBUG", |
@@ -258,12 +258,14 @@ static void | |||
258 | stop_arm (struct PeerContext *p) | 258 | stop_arm (struct PeerContext *p) |
259 | { | 259 | { |
260 | #if START_ARM | 260 | #if START_ARM |
261 | if (0 != PLIBC_KILL (p->arm_pid, SIGTERM)) | 261 | if (0 != GNUNET_OS_process_kill (p->arm_proc, SIGTERM)) |
262 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill"); | 262 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill"); |
263 | if (GNUNET_OS_process_wait(p->arm_pid) != GNUNET_OK) | 263 | if (GNUNET_OS_process_wait(p->arm_proc) != GNUNET_OK) |
264 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "waitpid"); | 264 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "waitpid"); |
265 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 265 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
266 | "ARM process %u stopped\n", p->arm_pid); | 266 | "ARM process %u stopped\n", GNUNET_OS_process_get_pid (p->arm_proc)); |
267 | GNUNET_OS_process_close (p->arm_proc); | ||
268 | p->arm_proc = NULL; | ||
267 | #endif | 269 | #endif |
268 | GNUNET_CONFIGURATION_destroy (p->cfg); | 270 | GNUNET_CONFIGURATION_destroy (p->cfg); |
269 | } | 271 | } |
diff --git a/src/fs/test_fs_search.c b/src/fs/test_fs_search.c index 98315ac5c..515730689 100644 --- a/src/fs/test_fs_search.c +++ b/src/fs/test_fs_search.c | |||
@@ -53,7 +53,7 @@ struct PeerContext | |||
53 | struct GNUNET_CONFIGURATION_Handle *cfg; | 53 | struct GNUNET_CONFIGURATION_Handle *cfg; |
54 | struct GNUNET_PeerIdentity id; | 54 | struct GNUNET_PeerIdentity id; |
55 | #if START_ARM | 55 | #if START_ARM |
56 | pid_t arm_pid; | 56 | GNUNET_OS_Process *arm_proc; |
57 | #endif | 57 | #endif |
58 | }; | 58 | }; |
59 | 59 | ||
@@ -191,7 +191,7 @@ setup_peer (struct PeerContext *p, const char *cfgname) | |||
191 | { | 191 | { |
192 | p->cfg = GNUNET_CONFIGURATION_create (); | 192 | p->cfg = GNUNET_CONFIGURATION_create (); |
193 | #if START_ARM | 193 | #if START_ARM |
194 | p->arm_pid = GNUNET_OS_start_process (NULL, NULL, "gnunet-service-arm", | 194 | p->arm_proc = GNUNET_OS_start_process (NULL, NULL, "gnunet-service-arm", |
195 | "gnunet-service-arm", | 195 | "gnunet-service-arm", |
196 | #if VERBOSE | 196 | #if VERBOSE |
197 | "-L", "DEBUG", | 197 | "-L", "DEBUG", |
@@ -206,12 +206,14 @@ static void | |||
206 | stop_arm (struct PeerContext *p) | 206 | stop_arm (struct PeerContext *p) |
207 | { | 207 | { |
208 | #if START_ARM | 208 | #if START_ARM |
209 | if (0 != PLIBC_KILL (p->arm_pid, SIGTERM)) | 209 | if (0 != GNUNET_OS_process_kill (p->arm_proc, SIGTERM)) |
210 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill"); | 210 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill"); |
211 | if (GNUNET_OS_process_wait(p->arm_pid) != GNUNET_OK) | 211 | if (GNUNET_OS_process_wait(p->arm_proc) != GNUNET_OK) |
212 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "waitpid"); | 212 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "waitpid"); |
213 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 213 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
214 | "ARM process %u stopped\n", p->arm_pid); | 214 | "ARM process %u stopped\n", GNUNET_OS_process_get_pid (p->arm_proc)); |
215 | GNUNET_OS_process_close (p->arm_proc); | ||
216 | p->arm_proc = NULL; | ||
215 | #endif | 217 | #endif |
216 | GNUNET_CONFIGURATION_destroy (p->cfg); | 218 | GNUNET_CONFIGURATION_destroy (p->cfg); |
217 | } | 219 | } |
diff --git a/src/fs/test_fs_search_persistence.c b/src/fs/test_fs_search_persistence.c index 97b7f656b..c2af22de4 100644 --- a/src/fs/test_fs_search_persistence.c +++ b/src/fs/test_fs_search_persistence.c | |||
@@ -53,7 +53,7 @@ struct PeerContext | |||
53 | struct GNUNET_CONFIGURATION_Handle *cfg; | 53 | struct GNUNET_CONFIGURATION_Handle *cfg; |
54 | struct GNUNET_PeerIdentity id; | 54 | struct GNUNET_PeerIdentity id; |
55 | #if START_ARM | 55 | #if START_ARM |
56 | pid_t arm_pid; | 56 | GNUNET_OS_Process *arm_proc; |
57 | #endif | 57 | #endif |
58 | }; | 58 | }; |
59 | 59 | ||
@@ -262,7 +262,7 @@ setup_peer (struct PeerContext *p, const char *cfgname) | |||
262 | { | 262 | { |
263 | p->cfg = GNUNET_CONFIGURATION_create (); | 263 | p->cfg = GNUNET_CONFIGURATION_create (); |
264 | #if START_ARM | 264 | #if START_ARM |
265 | p->arm_pid = GNUNET_OS_start_process (NULL, NULL, "gnunet-service-arm", | 265 | p->arm_proc = GNUNET_OS_start_process (NULL, NULL, "gnunet-service-arm", |
266 | "gnunet-service-arm", | 266 | "gnunet-service-arm", |
267 | #if VERBOSE | 267 | #if VERBOSE |
268 | "-L", "DEBUG", | 268 | "-L", "DEBUG", |
@@ -277,12 +277,14 @@ static void | |||
277 | stop_arm (struct PeerContext *p) | 277 | stop_arm (struct PeerContext *p) |
278 | { | 278 | { |
279 | #if START_ARM | 279 | #if START_ARM |
280 | if (0 != PLIBC_KILL (p->arm_pid, SIGTERM)) | 280 | if (0 != GNUNET_OS_process_kill (p->arm_proc, SIGTERM)) |
281 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill"); | 281 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill"); |
282 | if (GNUNET_OS_process_wait(p->arm_pid) != GNUNET_OK) | 282 | if (GNUNET_OS_process_wait(p->arm_proc) != GNUNET_OK) |
283 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "waitpid"); | 283 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "waitpid"); |
284 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 284 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
285 | "ARM process %u stopped\n", p->arm_pid); | 285 | "ARM process %u stopped\n", GNUNET_OS_process_get_pid (p->arm_proc)); |
286 | GNUNET_OS_process_close (p->arm_proc); | ||
287 | p->arm_proc = NULL; | ||
286 | #endif | 288 | #endif |
287 | GNUNET_CONFIGURATION_destroy (p->cfg); | 289 | GNUNET_CONFIGURATION_destroy (p->cfg); |
288 | } | 290 | } |
diff --git a/src/fs/test_fs_search_ranking.c b/src/fs/test_fs_search_ranking.c index 8c75bc1b1..06a069a32 100644 --- a/src/fs/test_fs_search_ranking.c +++ b/src/fs/test_fs_search_ranking.c | |||
@@ -126,7 +126,7 @@ int | |||
126 | main (int argc, char *argv[]) | 126 | main (int argc, char *argv[]) |
127 | { | 127 | { |
128 | #if START_DAEMON | 128 | #if START_DAEMON |
129 | pid_t daemon; | 129 | GNUNET_OS_Process *daemon; |
130 | #endif | 130 | #endif |
131 | int ok; | 131 | int ok; |
132 | char *fn = NULL; | 132 | char *fn = NULL; |
@@ -153,7 +153,7 @@ main (int argc, char *argv[]) | |||
153 | #if START_DAEMON | 153 | #if START_DAEMON |
154 | GNUNET_disk_directory_remove (NULL, "/tmp/gnunet-fsui-searchranktest/"); | 154 | GNUNET_disk_directory_remove (NULL, "/tmp/gnunet-fsui-searchranktest/"); |
155 | daemon = GNUNET_daemon_start (NULL, cfg, "peer.conf", GNUNET_NO); | 155 | daemon = GNUNET_daemon_start (NULL, cfg, "peer.conf", GNUNET_NO); |
156 | GNUNET_GE_ASSERT (NULL, daemon > 0); | 156 | GNUNET_GE_ASSERT (NULL, daemon != NULL); |
157 | CHECK (GNUNET_OK == | 157 | CHECK (GNUNET_OK == |
158 | GNUNET_wait_for_daemon_running (NULL, cfg, | 158 | GNUNET_wait_for_daemon_running (NULL, cfg, |
159 | 30 * GNUNET_CRON_SECONDS)); | 159 | 30 * GNUNET_CRON_SECONDS)); |
@@ -242,6 +242,8 @@ FAILURE: | |||
242 | 242 | ||
243 | #if START_DAEMON | 243 | #if START_DAEMON |
244 | GNUNET_GE_ASSERT (NULL, GNUNET_OK == GNUNET_daemon_stop (NULL, daemon)); | 244 | GNUNET_GE_ASSERT (NULL, GNUNET_OK == GNUNET_daemon_stop (NULL, daemon)); |
245 | GNUNET_OS_process_close (daemon); | ||
246 | daemon = NULL; | ||
245 | #endif | 247 | #endif |
246 | GNUNET_GC_free (cfg); | 248 | GNUNET_GC_free (cfg); |
247 | return (ok == GNUNET_YES) ? 0 : 1; | 249 | return (ok == GNUNET_YES) ? 0 : 1; |
diff --git a/src/fs/test_fs_start_stop.c b/src/fs/test_fs_start_stop.c index 7558ac46a..22fb64ae7 100644 --- a/src/fs/test_fs_start_stop.c +++ b/src/fs/test_fs_start_stop.c | |||
@@ -41,7 +41,7 @@ struct PeerContext | |||
41 | { | 41 | { |
42 | struct GNUNET_CONFIGURATION_Handle *cfg; | 42 | struct GNUNET_CONFIGURATION_Handle *cfg; |
43 | #if START_ARM | 43 | #if START_ARM |
44 | pid_t arm_pid; | 44 | GNUNET_OS_Process *arm_proc; |
45 | #endif | 45 | #endif |
46 | }; | 46 | }; |
47 | 47 | ||
@@ -59,7 +59,7 @@ setup_peer (struct PeerContext *p, const char *cfgname) | |||
59 | { | 59 | { |
60 | p->cfg = GNUNET_CONFIGURATION_create (); | 60 | p->cfg = GNUNET_CONFIGURATION_create (); |
61 | #if START_ARM | 61 | #if START_ARM |
62 | p->arm_pid = GNUNET_OS_start_process (NULL, NULL, "gnunet-service-arm", | 62 | p->arm_proc = GNUNET_OS_start_process (NULL, NULL, "gnunet-service-arm", |
63 | "gnunet-service-arm", | 63 | "gnunet-service-arm", |
64 | #if VERBOSE | 64 | #if VERBOSE |
65 | "-L", "DEBUG", | 65 | "-L", "DEBUG", |
@@ -74,12 +74,14 @@ static void | |||
74 | stop_arm (struct PeerContext *p) | 74 | stop_arm (struct PeerContext *p) |
75 | { | 75 | { |
76 | #if START_ARM | 76 | #if START_ARM |
77 | if (0 != PLIBC_KILL (p->arm_pid, SIGTERM)) | 77 | if (0 != GNUNET_OS_process_kill (p->arm_proc, SIGTERM)) |
78 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill"); | 78 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill"); |
79 | if (GNUNET_OS_process_wait(p->arm_pid) != GNUNET_OK) | 79 | if (GNUNET_OS_process_wait(p->arm_proc) != GNUNET_OK) |
80 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "waitpid"); | 80 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "waitpid"); |
81 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 81 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
82 | "ARM process %u stopped\n", p->arm_pid); | 82 | "ARM process %u stopped\n", GNUNET_OS_process_get_pid (p->arm_proc)); |
83 | GNUNET_OS_process_close (p->arm_proc); | ||
84 | p->arm_proc = NULL; | ||
83 | #endif | 85 | #endif |
84 | GNUNET_CONFIGURATION_destroy (p->cfg); | 86 | GNUNET_CONFIGURATION_destroy (p->cfg); |
85 | } | 87 | } |
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 | |||
52 | { | 52 | { |
53 | struct GNUNET_CONFIGURATION_Handle *cfg; | 53 | struct GNUNET_CONFIGURATION_Handle *cfg; |
54 | #if START_ARM | 54 | #if START_ARM |
55 | pid_t arm_pid; | 55 | GNUNET_OS_Process *arm_proc; |
56 | #endif | 56 | #endif |
57 | }; | 57 | }; |
58 | 58 | ||
@@ -196,7 +196,7 @@ setup_peer (struct PeerContext *p, const char *cfgname) | |||
196 | { | 196 | { |
197 | p->cfg = GNUNET_CONFIGURATION_create (); | 197 | p->cfg = GNUNET_CONFIGURATION_create (); |
198 | #if START_ARM | 198 | #if START_ARM |
199 | p->arm_pid = GNUNET_OS_start_process (NULL, NULL, "gnunet-service-arm", | 199 | p->arm_proc = GNUNET_OS_start_process (NULL, NULL, "gnunet-service-arm", |
200 | "gnunet-service-arm", | 200 | "gnunet-service-arm", |
201 | #if VERBOSE | 201 | #if VERBOSE |
202 | "-L", "DEBUG", | 202 | "-L", "DEBUG", |
@@ -211,12 +211,14 @@ static void | |||
211 | stop_arm (struct PeerContext *p) | 211 | stop_arm (struct PeerContext *p) |
212 | { | 212 | { |
213 | #if START_ARM | 213 | #if START_ARM |
214 | if (0 != PLIBC_KILL (p->arm_pid, SIGTERM)) | 214 | if (0 != GNUNET_OS_process_kill (p->arm_proc, SIGTERM)) |
215 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill"); | 215 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill"); |
216 | if (GNUNET_OS_process_wait(p->arm_pid) != GNUNET_OK) | 216 | if (GNUNET_OS_process_wait(p->arm_proc) != GNUNET_OK) |
217 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "waitpid"); | 217 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "waitpid"); |
218 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 218 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
219 | "ARM process %u stopped\n", p->arm_pid); | 219 | "ARM process %u stopped\n", GNUNET_OS_process_get_pid (p->arm_proc)); |
220 | GNUNET_OS_process_close (p->arm_proc); | ||
221 | p->arm_proc = NULL; | ||
220 | #endif | 222 | #endif |
221 | GNUNET_CONFIGURATION_destroy (p->cfg); | 223 | GNUNET_CONFIGURATION_destroy (p->cfg); |
222 | } | 224 | } |
diff --git a/src/fs/test_fs_unindex_persistence.c b/src/fs/test_fs_unindex_persistence.c index cbe08913f..d33ecb5fc 100644 --- a/src/fs/test_fs_unindex_persistence.c +++ b/src/fs/test_fs_unindex_persistence.c | |||
@@ -51,7 +51,7 @@ struct PeerContext | |||
51 | { | 51 | { |
52 | struct GNUNET_CONFIGURATION_Handle *cfg; | 52 | struct GNUNET_CONFIGURATION_Handle *cfg; |
53 | #if START_ARM | 53 | #if START_ARM |
54 | pid_t arm_pid; | 54 | GNUNET_OS_Process *arm_proc; |
55 | #endif | 55 | #endif |
56 | }; | 56 | }; |
57 | 57 | ||
@@ -266,7 +266,7 @@ setup_peer (struct PeerContext *p, const char *cfgname) | |||
266 | { | 266 | { |
267 | p->cfg = GNUNET_CONFIGURATION_create (); | 267 | p->cfg = GNUNET_CONFIGURATION_create (); |
268 | #if START_ARM | 268 | #if START_ARM |
269 | p->arm_pid = GNUNET_OS_start_process (NULL, NULL, "gnunet-service-arm", | 269 | p->arm_proc = GNUNET_OS_start_process (NULL, NULL, "gnunet-service-arm", |
270 | "gnunet-service-arm", | 270 | "gnunet-service-arm", |
271 | #if VERBOSE | 271 | #if VERBOSE |
272 | "-L", "DEBUG", | 272 | "-L", "DEBUG", |
@@ -281,12 +281,14 @@ static void | |||
281 | stop_arm (struct PeerContext *p) | 281 | stop_arm (struct PeerContext *p) |
282 | { | 282 | { |
283 | #if START_ARM | 283 | #if START_ARM |
284 | if (0 != PLIBC_KILL (p->arm_pid, SIGTERM)) | 284 | if (0 != GNUNET_OS_process_kill (p->arm_proc, SIGTERM)) |
285 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill"); | 285 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill"); |
286 | if (GNUNET_OS_process_wait(p->arm_pid) != GNUNET_OK) | 286 | if (GNUNET_OS_process_wait(p->arm_proc) != GNUNET_OK) |
287 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "waitpid"); | 287 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "waitpid"); |
288 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 288 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
289 | "ARM process %u stopped\n", p->arm_pid); | 289 | "ARM process %u stopped\n", GNUNET_OS_process_get_pid (p->arm_proc)); |
290 | GNUNET_OS_process_close (p->arm_proc); | ||
291 | p->arm_proc = NULL; | ||
290 | #endif | 292 | #endif |
291 | GNUNET_CONFIGURATION_destroy (p->cfg); | 293 | GNUNET_CONFIGURATION_destroy (p->cfg); |
292 | } | 294 | } |