summaryrefslogtreecommitdiffstats
path: root/sbin/hastd/hooks.c
diff options
context:
space:
mode:
authorpjd <pjd@FreeBSD.org>2011-01-12 14:38:17 +0000
committerpjd <pjd@FreeBSD.org>2011-01-12 14:38:17 +0000
commitb905920a72950a63c9782b4911d252bfac08db6e (patch)
tree65b185eeb47e34486099ed1bb0438c16507b79b2 /sbin/hastd/hooks.c
parent7a5b9c10d1eaba091cf2605b912bf6ee973896da (diff)
downloadFreeBSD-src-b905920a72950a63c9782b4911d252bfac08db6e.zip
FreeBSD-src-b905920a72950a63c9782b4911d252bfac08db6e.tar.gz
Add a note that when custom signal handler is installed for a signal,
signal action is restored to default in child after fork(2). In this case there is no need to do anything with dummy SIGCHLD handler, because after fork(2) it will be automatically reverted to SIG_IGN. Obtained from: Wheel Systems Sp. z o.o. http://www.wheelsystems.com MFC after: 3 days
Diffstat (limited to 'sbin/hastd/hooks.c')
-rw-r--r--sbin/hastd/hooks.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/sbin/hastd/hooks.c b/sbin/hastd/hooks.c
index bd13242..e54d545 100644
--- a/sbin/hastd/hooks.c
+++ b/sbin/hastd/hooks.c
@@ -372,6 +372,11 @@ hook_execv(const char *path, va_list ap)
descriptors();
PJDLOG_VERIFY(sigemptyset(&mask) == 0);
PJDLOG_VERIFY(sigprocmask(SIG_SETMASK, &mask, NULL) == 0);
+ /*
+ * Dummy handler set for SIGCHLD in the parent should be
+ * changed after fork(2) automatically to the default SIG_IGN,
+ * so there is no need to do anything with it.
+ */
execv(path, args);
pjdlog_errno(LOG_ERR, "Unable to execute %s", path);
exit(EX_SOFTWARE);
OpenPOWER on IntegriCloud