From: David Levine Date: Sat, 25 Jan 2014 16:50:29 +0000 (-0600) Subject: Added unregister_for_removal(0) calls to the couple of children X-Git-Url: https://diplodocus.org/git/nmh/commitdiff_plain/dd259aa56c8f8d816bc7b295cb5ad4ea80b1a8ab?ds=inline;hp=-c Added unregister_for_removal(0) calls to the couple of children that don't exec() or _exit() after fork(). --- dd259aa56c8f8d816bc7b295cb5ad4ea80b1a8ab diff --git a/sbr/context_save.c b/sbr/context_save.c index 5224af4c..d7d87e45 100644 --- a/sbr/context_save.c +++ b/sbr/context_save.c @@ -53,6 +53,8 @@ context_save (void) sigprocmask (SIG_SETMASK, &oset, &set); /* reset the signal mask */ if (action == 0) + /* This must be _exit(), not exit(), because the child didn't + call unregister_for_removal() in m_chkids(). */ _exit (0); /* we are child, time to die */ } @@ -83,6 +85,8 @@ m_chkids (void) break; case 0: + /* It's not necessary to call unregister_for_removal(0) + because the child calls _exit() in context_save(). */ setgid (getgid ()); setuid (getuid ()); break; diff --git a/sbr/push.c b/sbr/push.c index b4e3f498..39c58acc 100644 --- a/sbr/push.c +++ b/sbr/push.c @@ -37,6 +37,9 @@ push(void) SIGNAL (SIGTTIN, SIG_IGN); SIGNAL (SIGTTOU, SIG_IGN); #endif + + unregister_for_removal(0); + freopen ("/dev/null", "r", stdin); freopen ("/dev/null", "w", stdout); break; diff --git a/uip/sendsbr.c b/uip/sendsbr.c index ad48b882..a7dc38a9 100644 --- a/uip/sendsbr.c +++ b/uip/sendsbr.c @@ -623,6 +623,8 @@ anno (int fd, struct stat *st) sigaddset (&set, SIGTERM); sigprocmask (SIG_BLOCK, &set, &oset); + unregister_for_removal(0); + annoaux (fd); if (child_id == OK) _exit (0);