diff options
author | Christian Grothoff <christian@grothoff.org> | 2009-11-04 14:13:53 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2009-11-04 14:13:53 +0000 |
commit | 68525a1c4a138ad17baacf5231115495ceaa9620 (patch) | |
tree | 006d7b961314bff4845ef983f169cd72477162f7 /src | |
parent | cf45b8dff29c366d51aa2e6ea6a64b99b514b9c9 (diff) | |
download | gnunet-68525a1c4a138ad17baacf5231115495ceaa9620.tar.gz gnunet-68525a1c4a138ad17baacf5231115495ceaa9620.zip |
immediately kill, then wait
Diffstat (limited to 'src')
-rw-r--r-- | src/arm/gnunet-service-arm.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/arm/gnunet-service-arm.c b/src/arm/gnunet-service-arm.c index bfb3896bf..2760f9156 100644 --- a/src/arm/gnunet-service-arm.c +++ b/src/arm/gnunet-service-arm.c | |||
@@ -625,11 +625,16 @@ maint (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
625 | if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) | 625 | if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) |
626 | { | 626 | { |
627 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, _("Stopping all services\n")); | 627 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, _("Stopping all services\n")); |
628 | while (NULL != (pos = running)) | 628 | pos = running; |
629 | while (NULL != pos) | ||
629 | { | 630 | { |
630 | running = pos->next; | ||
631 | if (0 != PLIBC_KILL (pos->pid, SIGTERM)) | 631 | if (0 != PLIBC_KILL (pos->pid, SIGTERM)) |
632 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill"); | 632 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill"); |
633 | pos = pos->next; | ||
634 | } | ||
635 | while (NULL != (pos = running)) | ||
636 | { | ||
637 | running = pos->next; | ||
633 | if (GNUNET_OK != GNUNET_OS_process_wait(pos->pid)) | 638 | if (GNUNET_OK != GNUNET_OS_process_wait(pos->pid)) |
634 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "waitpid"); | 639 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "waitpid"); |
635 | free_entry (pos); | 640 | free_entry (pos); |