1
0
Fork 0
mirror of https://repo.or.cz/socat.git synced 2025-07-10 06:06:33 +00:00

The async-signal-safe fix used internally FD 3 and FD 4 which could conflict with options fdin,fdout

This commit is contained in:
Gerhard Rieger 2018-07-29 11:12:30 +02:00
parent a3c688210f
commit 9f5abda361
5 changed files with 86 additions and 1 deletions

13
error.c
View file

@ -210,6 +210,19 @@ const char *diag_get_string(char what) {
return NULL;
}
/* make sure that the diag_sock fds do not have this num */
int diag_reserve_fd(int fd) {
DIAG_INIT;
if (diag_sock_send == fd) {
diag_sock_send = Dup(fd);
Close(fd);
}
if (diag_sock_recv == fd) {
diag_sock_recv = Dup(fd);
Close(fd);
}
return 0;
}
/* Linux and AIX syslog format:
Oct 4 17:10:37 hostname socat[52798]: D signal(13, 1)