mirror of
https://repo.or.cz/socat.git
synced 2025-07-07 21:36:32 +00:00
Replaced SIGUSR1 with socketpair for synchronization between parent and child processes on RECVFROM type addresses
This commit is contained in:
parent
a0e17a813a
commit
02483ff39e
12 changed files with 269 additions and 257 deletions
|
@ -217,6 +217,15 @@ pid_t xio_fork(bool subchild, int level) {
|
|||
if (!subchild) {
|
||||
/* set SOCAT_PID to new value */
|
||||
xiosetenvulong("PID", pid, 1);
|
||||
} else {
|
||||
/* Make sure the sub process does not hold the trigger pipe open */
|
||||
if (sock1 != NULL) {
|
||||
struct single *sfd;
|
||||
sfd = XIO_RDSTREAM(sock1);
|
||||
if (sfd->triggerfd >= 0) Close(sfd->triggerfd);
|
||||
sfd = XIO_WRSTREAM(sock1);
|
||||
if (sfd->triggerfd >= 0) Close(sfd->triggerfd);
|
||||
}
|
||||
}
|
||||
/* gdb recommends to have env controlled sleep after fork */
|
||||
if (forkwaitstring = getenv("SOCAT_FORK_WAIT")) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue