aboutsummaryrefslogtreecommitdiff
path: root/src/fs
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2015-08-18 18:00:21 +0000
committerChristian Grothoff <christian@grothoff.org>2015-08-18 18:00:21 +0000
commit1056df3b3f043bbeca91198194ca34929abfcdc3 (patch)
tree62d3936aaf27257431e91ee68fd1cbe2be881976 /src/fs
parenteb4ebfca26250af0816abf08c5e3364de88c950a (diff)
downloadgnunet-1056df3b3f043bbeca91198194ca34929abfcdc3.tar.gz
gnunet-1056df3b3f043bbeca91198194ca34929abfcdc3.zip
tolerate spurious SIGCHLD in gnunet-auto-share
Diffstat (limited to 'src/fs')
-rw-r--r--src/fs/gnunet-auto-share.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/fs/gnunet-auto-share.c b/src/fs/gnunet-auto-share.c
index fc85b29e4..ae332af49 100644
--- a/src/fs/gnunet-auto-share.c
+++ b/src/fs/gnunet-auto-share.c
@@ -378,6 +378,8 @@ maint_child_death (void *cls,
378 &maint_child_death, wi); 378 &maint_child_death, wi);
379 return; 379 return;
380 } 380 }
381 /* consume the signal */
382 GNUNET_break (0 < GNUNET_DISK_file_read (pr, &c, sizeof (c)));
381 383
382 ret = GNUNET_OS_process_status (publish_proc, 384 ret = GNUNET_OS_process_status (publish_proc,
383 &type, 385 &type,
@@ -385,21 +387,20 @@ maint_child_death (void *cls,
385 GNUNET_assert (GNUNET_SYSERR != ret); 387 GNUNET_assert (GNUNET_SYSERR != ret);
386 if (GNUNET_NO == ret) 388 if (GNUNET_NO == ret)
387 { 389 {
388 /* process still running? Well, how did we get here? 390 /* process still running? Then where did the SIGCHLD come from?
389 Anyway, answer is to kill it! */ 391 Well, let's declare it spurious (kernel bug?) and keep rolling.
392 */
390 GNUNET_break (0); 393 GNUNET_break (0);
391 GNUNET_OS_process_kill (publish_proc, 394 run_task =
392 SIGKILL); 395 GNUNET_SCHEDULER_add_read_file (GNUNET_TIME_UNIT_FOREVER_REL,
393 ret = GNUNET_OS_process_status (publish_proc, 396 pr,
394 &type, 397 &maint_child_death, wi);
395 &code); 398 return;
396 } 399 }
397 GNUNET_assert (GNUNET_OK == ret); 400 GNUNET_assert (GNUNET_OK == ret);
398 401
399 GNUNET_OS_process_destroy (publish_proc); 402 GNUNET_OS_process_destroy (publish_proc);
400 publish_proc = NULL; 403 publish_proc = NULL;
401 /* consume the signal */
402 GNUNET_break (0 < GNUNET_DISK_file_read (pr, &c, sizeof (c)));
403 404
404 if (GNUNET_YES == do_shutdown) 405 if (GNUNET_YES == do_shutdown)
405 { 406 {