Added forked processes termination

This commit is contained in:
Dmitriy Shishkov 2022-10-15 09:19:18 +03:00
parent 72eb14f9e0
commit 15147b6430

View File

@ -58,6 +58,11 @@ void handle_connection(int fd)
close(fd);
}
void handle_process_termination(int signum)
{
wait(NULL);
}
/**
* Main
*/
@ -116,8 +121,10 @@ int main(int argc, char *argv[])
handle_connection(client_fd);
exit(0);
}
else
else {
close(client_fd);
signal(SIGCHLD, handle_process_termination);
}
}
return 0;