diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2001-11-05 09:58:14 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2001-11-05 09:58:14 +0000 |
commit | c4c4dc76753a5e94426d15536edeba5c7714a6dc (patch) | |
tree | 28c76e68a542ec840388f7dc4b1907610bab8700 /sbin/mount_portal/mount_portal.c | |
parent | 1463f3cb36a3063339f2c99a85b4db002ff187ff (diff) |
some syslog_r uses in signal handlers
Diffstat (limited to 'sbin/mount_portal/mount_portal.c')
-rw-r--r-- | sbin/mount_portal/mount_portal.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/sbin/mount_portal/mount_portal.c b/sbin/mount_portal/mount_portal.c index 9f460777094..d3ea7a53dfa 100644 --- a/sbin/mount_portal/mount_portal.c +++ b/sbin/mount_portal/mount_portal.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mount_portal.c,v 1.14 2001/01/19 17:57:39 deraadt Exp $ */ +/* $OpenBSD: mount_portal.c,v 1.15 2001/11/05 09:58:13 deraadt Exp $ */ /* $NetBSD: mount_portal.c,v 1.8 1996/04/13 01:31:54 jtc Exp $ */ /* @@ -47,7 +47,7 @@ char copyright[] = #if 0 static char sccsid[] = "@(#)mount_portal.c 8.6 (Berkeley) 4/26/95"; #else -static char rcsid[] = "$OpenBSD: mount_portal.c,v 1.14 2001/01/19 17:57:39 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: mount_portal.c,v 1.15 2001/11/05 09:58:13 deraadt Exp $"; #endif #endif /* not lint */ @@ -88,12 +88,13 @@ sigchld(sig) int sig; { int save_errno = errno; + struct syslog_data sdata = SYSLOG_DATA_INIT; pid_t pid; while ((pid = waitpid((pid_t) -1, NULL, WNOHANG)) > 0) ; if (pid < 0 && errno != ECHILD) - syslog(LOG_WARNING, "waitpid: %m"); /* XXX signal race */ + syslog_r(LOG_WARNING, &sdata, "waitpid: %m"); errno = save_errno; } @@ -109,10 +110,12 @@ static void sigterm(sig) int sig; { - /* XXX signal races */ + struct syslog_data sdata = SYSLOG_DATA_INIT; + if (unmount(mountpt, MNT_FORCE) < 0) - syslog(LOG_WARNING, "sigterm: unmounting %s failed: %m", - mountpt); + syslog_r(LOG_WARNING, &sdata, + "sigterm: unmounting %s failed: %m", mountpt); + _exit(1); } int |