1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 16:27:35 +00:00

Terminal: Ignore SIGCHLD with SA_NOCLDWAIT

Otherwise we'll accumulate a bunch of dead Terminal children if you
open and close more terminal windows.
This commit is contained in:
Andreas Kling 2019-12-02 16:50:10 +01:00
parent 340c5506b4
commit 790a27a444

View file

@ -18,6 +18,7 @@
#include <errno.h>
#include <fcntl.h>
#include <pwd.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@ -137,6 +138,16 @@ RefPtr<GWindow> create_settings_window(TerminalWidget& terminal, RefPtr<CConfigF
int main(int argc, char** argv)
{
struct sigaction act;
memset(&act, 0, sizeof(act));
act.sa_flags = SA_NOCLDWAIT;
act.sa_handler = SIG_IGN;
int rc = sigaction(SIGCHLD, &act, nullptr);
if (rc < 0) {
perror("sigaction");
return 1;
}
GApplication app(argc, argv);
CArgsParser args_parser("Terminal");