diff options
author | Christian Grothoff <christian@grothoff.org> | 2013-05-21 12:57:28 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2013-05-21 12:57:28 +0000 |
commit | a4406e4f8c9c84f429be507d797f4ff210bb74f0 (patch) | |
tree | b1bfa4b055e48a8fcfe5bf178ade6d88e7b7dcbf /src/util/helper.c | |
parent | 39d39b9493a419b361ffd7423f9f57640ca459cc (diff) | |
download | gnunet-a4406e4f8c9c84f429be507d797f4ff210bb74f0.tar.gz gnunet-a4406e4f8c9c84f429be507d797f4ff210bb74f0.zip |
-handle case that we are in restart on stop
Diffstat (limited to 'src/util/helper.c')
-rw-r--r-- | src/util/helper.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/util/helper.c b/src/util/helper.c index c89f1ecb5..4187b819c 100644 --- a/src/util/helper.c +++ b/src/util/helper.c | |||
@@ -276,8 +276,16 @@ GNUNET_HELPER_wait (struct GNUNET_HELPER_Handle *h) | |||
276 | static void | 276 | static void |
277 | stop_helper (struct GNUNET_HELPER_Handle *h, int soft_kill) | 277 | stop_helper (struct GNUNET_HELPER_Handle *h, int soft_kill) |
278 | { | 278 | { |
279 | GNUNET_break (GNUNET_OK == GNUNET_HELPER_kill (h, soft_kill)); | 279 | if (GNUNET_SCHEDULER_NO_TASK != h->restart_task) |
280 | GNUNET_break (GNUNET_OK == GNUNET_HELPER_wait (h)); | 280 | { |
281 | GNUNET_SCHEDULER_cancel (h->restart_task); | ||
282 | h->restart_task = GNUNET_SCHEDULER_NO_TASK; | ||
283 | } | ||
284 | else | ||
285 | { | ||
286 | GNUNET_break (GNUNET_OK == GNUNET_HELPER_kill (h, soft_kill)); | ||
287 | GNUNET_break (GNUNET_OK == GNUNET_HELPER_wait (h)); | ||
288 | } | ||
281 | } | 289 | } |
282 | 290 | ||
283 | 291 | ||