]> 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 5224af4ce403a7a390c2246fd3d8db82064949e6..d7d87e45f5c6b51ab4d8ab3d694ad38d96ea793a 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 b4e3f4983f2297540f5494f797377bbdb22c3775..39c58acc8a093888734c0653b1626f77c411e295 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 ad48b882ef81218ff48f0ac499b27622987d10ba..a7dc38a9f6c5e545b90734d48b0db404b9a6baa9 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);