diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2003-10-22 19:21:58 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2003-10-22 19:21:58 +0000 |
commit | 003d15deb6f54de29515b9e61ae6d028aa2d6874 (patch) | |
tree | 3a8d1e65681828597a37924b586eacc43014d38c | |
parent | da83f0b9bfa8df955a54a117dc1fe674e6e27f77 (diff) |
caution with kill
-rw-r--r-- | sbin/pflogd/privsep.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sbin/pflogd/privsep.c b/sbin/pflogd/privsep.c index 5b72a705ffe..fbbe0162bb7 100644 --- a/sbin/pflogd/privsep.c +++ b/sbin/pflogd/privsep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: privsep.c,v 1.1 2003/10/22 18:51:55 canacar Exp $ */ +/* $OpenBSD: privsep.c,v 1.2 2003/10/22 19:21:57 deraadt Exp $ */ /* * Copyright (c) 2003 Can Erkin Acar @@ -45,7 +45,7 @@ enum cmd_types { }; static int priv_fd = -1; -static pid_t child_pid; +static pid_t child_pid = -1; volatile sig_atomic_t gotsig_chld = 0; @@ -213,7 +213,8 @@ priv_open_log(void) static void sig_pass_to_chld(int sig) { - kill(child_pid, sig); + if (child_pid != -1) + kill(child_pid, sig); } /* if parent gets a SIGCHLD, it will exit */ |