diff options
author | Hakan Olsson <ho@cvs.openbsd.org> | 2005-05-26 19:18:17 +0000 |
---|---|---|
committer | Hakan Olsson <ho@cvs.openbsd.org> | 2005-05-26 19:18:17 +0000 |
commit | 9fa2df49dfe3c9c1bbb77d3ef6fdf2ef9387aea4 (patch) | |
tree | a2d0979b58cf7cd0741b1b9ff67b9a4e762760a4 /usr.sbin | |
parent | 2c86d4412cc09f0025505fbc1362d25eb01cb19c (diff) |
check ppid
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/sasyncd/sasyncd.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/usr.sbin/sasyncd/sasyncd.c b/usr.sbin/sasyncd/sasyncd.c index 0a76273b1b6..d5193fa4b5e 100644 --- a/usr.sbin/sasyncd/sasyncd.c +++ b/usr.sbin/sasyncd/sasyncd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sasyncd.c,v 1.8 2005/05/24 02:35:39 ho Exp $ */ +/* $OpenBSD: sasyncd.c,v 1.9 2005/05/26 19:18:16 ho Exp $ */ /* * Copyright (c) 2005 Håkan Olsson. All rights reserved. @@ -53,7 +53,7 @@ sasyncd_stop(int s) } static int -sasyncd_run(void) +sasyncd_run(pid_t ppid) { struct timeval *timeout, tv; fd_set *rfds, *wfds; @@ -108,6 +108,12 @@ sasyncd_run(void) pfkey_send_message(wfds); } timer_run(); + + /* Mostly for debugging. */ + if (getppid() != ppid) { + log_msg(0, "sasyncd: parent died"); + daemon_shutdown++; + } } free(rfds); free(wfds); @@ -168,7 +174,7 @@ main(int argc, char **argv) } /* Child, no privileges left. Run main loop. */ - sasyncd_run(); + sasyncd_run(getppid()); /* Shutdown. */ log_msg(0, "shutting down..."); |