diff options
author | Sree Harsha Totakura <totakura@in.tum.de> | 2012-07-27 10:09:05 +0000 |
---|---|---|
committer | Sree Harsha Totakura <totakura@in.tum.de> | 2012-07-27 10:09:05 +0000 |
commit | 36e4b39d0ac70f4a413882164c0d79033f66743f (patch) | |
tree | f11f991a8a1b48b446474fde7a8de74d6a052b9e /src/testbed | |
parent | 01d55b7cd66423b2630b78c0bbc144362a1f37aa (diff) | |
download | gnunet-36e4b39d0ac70f4a413882164c0d79033f66743f.tar.gz gnunet-36e4b39d0ac70f4a413882164c0d79033f66743f.zip |
helper shutdown on stdin close
Diffstat (limited to 'src/testbed')
-rw-r--r-- | src/testbed/gnunet-testbed-helper.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/testbed/gnunet-testbed-helper.c b/src/testbed/gnunet-testbed-helper.c index 942a9e549..215f680b3 100644 --- a/src/testbed/gnunet-testbed-helper.c +++ b/src/testbed/gnunet-testbed-helper.c | |||
@@ -154,6 +154,7 @@ shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
154 | tokenizer = NULL; | 154 | tokenizer = NULL; |
155 | if (NULL != testbed) | 155 | if (NULL != testbed) |
156 | { | 156 | { |
157 | LOG_DEBUG ("Killing testbed\n"); | ||
157 | GNUNET_break (0 == GNUNET_OS_process_kill (testbed, SIGTERM)); | 158 | GNUNET_break (0 == GNUNET_OS_process_kill (testbed, SIGTERM)); |
158 | GNUNET_assert (GNUNET_OK == GNUNET_OS_process_wait (testbed)); | 159 | GNUNET_assert (GNUNET_OK == GNUNET_OS_process_wait (testbed)); |
159 | GNUNET_OS_process_destroy (testbed); | 160 | GNUNET_OS_process_destroy (testbed); |
@@ -337,7 +338,7 @@ read_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
337 | if (0 != (GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason)) | 338 | if (0 != (GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason)) |
338 | return; | 339 | return; |
339 | sread = GNUNET_DISK_file_read (stdin_fd, buf, sizeof (buf)); | 340 | sread = GNUNET_DISK_file_read (stdin_fd, buf, sizeof (buf)); |
340 | if (GNUNET_SYSERR == sread) | 341 | if ((GNUNET_SYSERR == sread) || (0 == sread)) |
341 | { | 342 | { |
342 | GNUNET_SCHEDULER_shutdown (); | 343 | GNUNET_SCHEDULER_shutdown (); |
343 | return; | 344 | return; |
@@ -388,8 +389,7 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
388 | 389 | ||
389 | 390 | ||
390 | /** | 391 | /** |
391 | * Signal handler called for SIGCHLD. Triggers the | 392 | * Signal handler called for SIGCHLD. |
392 | * respective handler by writing to the trigger pipe. | ||
393 | */ | 393 | */ |
394 | static void | 394 | static void |
395 | sighandler_child_death () | 395 | sighandler_child_death () |