From 9d9f91074328255eb4fe821a01a3ea2298b57fee Mon Sep 17 00:00:00 2001 From: madpilot Date: Wed, 15 Apr 2020 14:55:03 +0000 Subject: [PATCH] MFH: r531758 Import patch from upstream pull request to stop easystroke creating zombie processes for each spawned process. Obtained from: https://github.com/thjaeger/easystroke/pull/6 Approved by: portmgr (blanket: runtime fix) --- deskutils/easystroke/Makefile | 2 +- deskutils/easystroke/files/patch-actiondb.cc | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 deskutils/easystroke/files/patch-actiondb.cc diff --git a/deskutils/easystroke/Makefile b/deskutils/easystroke/Makefile index 48bd8a0bc7c64..94b12d314cdda 100644 --- a/deskutils/easystroke/Makefile +++ b/deskutils/easystroke/Makefile @@ -3,7 +3,7 @@ PORTNAME= easystroke PORTVERSION= 0.6.0 -PORTREVISION= 21 +PORTREVISION= 22 CATEGORIES= deskutils MASTER_SITES= SF diff --git a/deskutils/easystroke/files/patch-actiondb.cc b/deskutils/easystroke/files/patch-actiondb.cc new file mode 100644 index 0000000000000..cfbdf2ee92a4e --- /dev/null +++ b/deskutils/easystroke/files/patch-actiondb.cc @@ -0,0 +1,20 @@ +--- actiondb.cc.orig 2013-03-27 15:52:38 UTC ++++ actiondb.cc +@@ -118,14 +118,9 @@ template void StrokeInfo::serialize(Arc + using namespace std; + + void Command::run() { +- pid_t pid = fork(); +- switch (pid) { +- case 0: +- execlp("/bin/sh", "sh", "-c", cmd.c_str(), NULL); +- exit(1); +- case -1: +- printf(_("Error: can't execute command \"%s\": fork() failed\n"), cmd.c_str()); +- } ++ gchar* argv[] = {(gchar*) "/bin/sh", (gchar*) "-c", NULL, NULL}; ++ argv[2] = (gchar *) cmd.c_str(); ++ g_spawn_async(NULL, argv, NULL, G_SPAWN_SEARCH_PATH, NULL, NULL, NULL, NULL); + } + + ButtonInfo Button::get_button_info() const {