]> diplodocus.org Git - nmh/commitdiff
Added unregister_for_removal(0) calls to the couple of children
authorDavid Levine <levinedl@acm.org>
Sat, 25 Jan 2014 16:50:29 +0000 (10:50 -0600)
committerDavid Levine <levinedl@acm.org>
Sat, 25 Jan 2014 16:50:29 +0000 (10:50 -0600)
that don't exec() or _exit() after fork().

sbr/context_save.c
sbr/push.c
uip/sendsbr.c

index 5224af4..d7d87e4 100644 (file)
@@ -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;
index b4e3f49..39c58ac 100644 (file)
@@ -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;
index ad48b88..a7dc38a 100644 (file)
@@ -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);