mirror of
https://github.com/tsl0922/ttyd.git
synced 2026-01-01 00:14:23 +01:00
src: fix exit code check on linux
This commit is contained in:
@@ -186,6 +186,14 @@ sigchld_handler() {
|
||||
int status = wait_proc(-1, &pid);
|
||||
if (pid > 0) {
|
||||
lwsl_notice("process exited with code %d, pid: %d\n", status, pid);
|
||||
struct tty_client *iterator;
|
||||
LIST_FOREACH(iterator, &server->clients, list) {
|
||||
if (iterator->pid == pid) {
|
||||
iterator->running = false;
|
||||
iterator->exit_status = status;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user