From 006ea0e09a665ab7043c26ad1a6226b459540cb5 Mon Sep 17 00:00:00 2001 From: Namgo Date: Tue, 3 Oct 2023 13:17:36 -0400 Subject: [PATCH] berry: add patch to address zombie process Closes: #46416 [via git-merge-pr] Closes: #46039 --- srcpkgs/berry/patches/no-zombies.patch | 41 ++++++++++++++++++++++++++ srcpkgs/berry/template | 2 +- 2 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 srcpkgs/berry/patches/no-zombies.patch diff --git a/srcpkgs/berry/patches/no-zombies.patch b/srcpkgs/berry/patches/no-zombies.patch new file mode 100644 index 00000000000..a43d050baa9 --- /dev/null +++ b/srcpkgs/berry/patches/no-zombies.patch @@ -0,0 +1,41 @@ +https://patch-diff.githubusercontent.com/raw/JLErvin/berry/pull/198.patch + +From 3501ee006ee9bdddc817fd71750e431b4186a0c7 Mon Sep 17 00:00:00 2001 +From: Joseph Eib +Date: Wed, 30 Nov 2022 17:10:43 -0500 +Subject: [PATCH] Avoid creation of zombie process by load_config + +Previously, a zombie process was created when the process forked in +load_config terminates because the parent does not call wait or waitpid. +It is unreasonable to wait for the child because a user may exec their +autostart script into a long-running process. Instead, the parent now +simply ignores SIGCHLD which allows the child to be reaped immediately +upon termination. +--- + wm.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/wm.c b/wm.c +index f3a01b8..b863bea 100644 +--- a/wm.c ++++ b/wm.c +@@ -4,6 +4,7 @@ + #include "config.h" + + #include ++#include + #include + #include + #include +@@ -2536,8 +2537,10 @@ main(int argc, char *argv[]) + LOGN("Successfully opened display"); + + setup(); +- if (conf_found) ++ if (conf_found) { ++ signal(SIGCHLD, SIG_IGN); + load_config(conf_path); ++ } + run(); + close_wm(); + free(font_name); diff --git a/srcpkgs/berry/template b/srcpkgs/berry/template index 1012a9b935e..5ea22d9a413 100644 --- a/srcpkgs/berry/template +++ b/srcpkgs/berry/template @@ -1,7 +1,7 @@ # Template file for 'berry' pkgname=berry version=0.1.12 -revision=1 +revision=2 build_style=configure configure_args="--prefix=/usr" hostmakedepends="pkg-config which"