mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 19:37:36 +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:
parent
340c5506b4
commit
790a27a444
1 changed files with 11 additions and 0 deletions
|
@ -18,6 +18,7 @@
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <pwd.h>
|
#include <pwd.h>
|
||||||
|
#include <signal.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
@ -137,6 +138,16 @@ RefPtr<GWindow> create_settings_window(TerminalWidget& terminal, RefPtr<CConfigF
|
||||||
|
|
||||||
int main(int argc, char** argv)
|
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);
|
GApplication app(argc, argv);
|
||||||
|
|
||||||
CArgsParser args_parser("Terminal");
|
CArgsParser args_parser("Terminal");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue