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

Process last data of failed child process

This commit is contained in:
Gerhard Rieger 2023-06-15 12:53:32 +02:00
parent 4bab097ffc
commit a0e17a813a
4 changed files with 17 additions and 2 deletions

View file

@ -13,6 +13,7 @@
pid_t diedunknown[NUMUNKNOWN]; /* children that died before they were registered */
int statunknown[NUMUNKNOWN]; /* exit state of unknown dead child */
size_t nextunknown;
int engine_result = EXIT_SUCCESS;
/* register for a xio filedescriptor a callback (handler).
@ -138,8 +139,9 @@ void childdied(int signum) {
Info2("waitpid(): child %d exited with status %d",
pid, WEXITSTATUS(status));
} else {
Error2("waitpid(): child %d exited with status %d",
Warn2("waitpid(): child %d exited with status %d",
pid, WEXITSTATUS(status));
engine_result = 1;
}
}
} else if (WIFSIGNALED(status)) {
@ -147,8 +149,9 @@ void childdied(int signum) {
Info2("waitpid(): child %d exited on signal %d",
pid, WTERMSIG(status));
} else {
Error2("waitpid(): child %d exited on signal %d",
Warn2("waitpid(): child %d exited on signal %d",
pid, WTERMSIG(status));
engine_result = 1;
}
} else if (WIFSTOPPED(status)) {
Info2("waitpid(): child %d stopped on signal %d",