diff options
| author | Murray Stokely <murray@FreeBSD.org> | 2001-09-06 09:53:53 +0000 |
|---|---|---|
| committer | Murray Stokely <murray@FreeBSD.org> | 2001-09-06 09:53:53 +0000 |
| commit | 810fd59fbbf06dfde14df0d5b558856ff8452c05 (patch) | |
| tree | 5459d31b5baa5c83343f1291fc1827bac94f8d9a | |
| parent | 3da21d9f070724d00b64e19c667fdd2ede7fba5b (diff) | |
Notes
| -rw-r--r-- | usr.sbin/sade/system.c | 13 | ||||
| -rw-r--r-- | usr.sbin/sysinstall/system.c | 13 |
2 files changed, 26 insertions, 0 deletions
diff --git a/usr.sbin/sade/system.c b/usr.sbin/sade/system.c index dbf0dc5b4245..dc3e83344f18 100644 --- a/usr.sbin/sade/system.c +++ b/usr.sbin/sade/system.c @@ -85,6 +85,18 @@ handle_intr(int sig) restorescr(save); } +/* + * Harvest children if we are init. + */ +static void +reap_children(int sig) +{ + int errbak = errno; + while ( waitpid(-1, NULL, WNOHANG) > 0 ) + ; + errno = errbak; +} + /* Expand a file into a convenient location, nuking it each time */ static char * expand(char *fname) @@ -166,6 +178,7 @@ systemInitialize(int argc, char **argv) i = 0; sysctlbyname("machdep.unaligned_print", NULL, 0, &i, sizeof(i)); #endif + signal(SIGCHLD, reap_children); } else { char hname[256]; diff --git a/usr.sbin/sysinstall/system.c b/usr.sbin/sysinstall/system.c index dbf0dc5b4245..dc3e83344f18 100644 --- a/usr.sbin/sysinstall/system.c +++ b/usr.sbin/sysinstall/system.c @@ -85,6 +85,18 @@ handle_intr(int sig) restorescr(save); } +/* + * Harvest children if we are init. + */ +static void +reap_children(int sig) +{ + int errbak = errno; + while ( waitpid(-1, NULL, WNOHANG) > 0 ) + ; + errno = errbak; +} + /* Expand a file into a convenient location, nuking it each time */ static char * expand(char *fname) @@ -166,6 +178,7 @@ systemInitialize(int argc, char **argv) i = 0; sysctlbyname("machdep.unaligned_print", NULL, 0, &i, sizeof(i)); #endif + signal(SIGCHLD, reap_children); } else { char hname[256]; |
