summaryrefslogtreecommitdiffstats
path: root/usr.sbin
diff options
context:
space:
mode:
authorpjd <pjd@FreeBSD.org>2013-09-05 01:05:48 +0000
committerpjd <pjd@FreeBSD.org>2013-09-05 01:05:48 +0000
commit3c622b2c1ff0effcf62f9b3ce3c9c698382a1fd4 (patch)
tree5e67d7337e12add4f6d42c1433f0a65ff6b0ac83 /usr.sbin
parent58db73786bebc44342321a87e1bf763b4d3d9cfc (diff)
downloadFreeBSD-src-3c622b2c1ff0effcf62f9b3ce3c9c698382a1fd4.zip
FreeBSD-src-3c622b2c1ff0effcf62f9b3ce3c9c698382a1fd4.tar.gz
Remove fallback to fork(2) if pdfork(2) is not available. If the parent
process dies, the process descriptor will be closed and pdfork(2)ed child will be killed, which is not the case when regular fork(2) is used. The PROCDESC option is now part of the GENERIC kernel configuration, so we can start depending on it. Add UPDATING entry to inform that this option is now required and log detailed instruction to syslog if pdfork(2) is not available: The pdfork(2) system call is not available; recompile the kernel with options PROCDESC Submitted by: Mariusz Zaborski <oshogbo@FreeBSD.org> Sponsored by: Google Summer of Code 2013
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/rwhod/rwhod.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/usr.sbin/rwhod/rwhod.c b/usr.sbin/rwhod/rwhod.c
index 5dc6079..87a4166 100644
--- a/usr.sbin/rwhod/rwhod.c
+++ b/usr.sbin/rwhod/rwhod.c
@@ -274,21 +274,17 @@ main(int argc, char *argv[])
exit(1);
if (!quiet_mode) {
pid_child_receiver = pdfork(&fdp, 0);
- if (pid_child_receiver == -1) {
- if (errno != ENOSYS) {
- syslog(LOG_ERR, "pdfork: %m");
- exit(1);
- } else {
- pid_child_receiver = fork();
- fdp = -1;
- }
- }
if (pid_child_receiver == 0) {
receiver_process();
} else if (pid_child_receiver > 0) {
sender_process();
} else if (pid_child_receiver == -1) {
- syslog(LOG_ERR, "pdfork: %m");
+ if (errno == ENOSYS) {
+ syslog(LOG_ERR,
+ "The pdfork(2) system call is not available; recompile the kernel with options PROCDESC");
+ } else {
+ syslog(LOG_ERR, "pdfork: %m");
+ }
exit(1);
}
} else {
OpenPOWER on IntegriCloud