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/test_fs_start_stop.c | |
parent | 37ac1b7c9e9e05f93d4100cfb53450ec2d370989 (diff) | |
download | gnunet-721e49caeea6ba5073f8bc5c6c08359295c02bb5.tar.gz gnunet-721e49caeea6ba5073f8bc5c6c08359295c02bb5.zip |
original patch from Mantis 1614
Diffstat (limited to 'src/fs/test_fs_start_stop.c')
-rw-r--r-- | src/fs/test_fs_start_stop.c | 12 |
1 files changed, 7 insertions, 5 deletions
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 | } |