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
This commit is contained in:
parent
58db73786b
commit
3c622b2c1f
6
UPDATING
6
UPDATING
@ -31,6 +31,12 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 10.x IS SLOW:
|
||||
disable the most expensive debugging functionality run
|
||||
"ln -s 'abort:false,junk:false' /etc/malloc.conf".)
|
||||
|
||||
20130905:
|
||||
The PROCDESC kernel option is now part of the GENERIC kernel
|
||||
configuration and is required for the rwhod(8) to work.
|
||||
If you are using custom kernel configuration, you should include
|
||||
'options PROCDESC'.
|
||||
|
||||
20130905:
|
||||
The API and ABI related to the Capsicum framework was modified
|
||||
in backward incompatible way. The userland libraries and programs
|
||||
|
@ -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) {
|
||||
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 {
|
||||
|
Loading…
Reference in New Issue
Block a user