Blob Blame Raw
diff -up easystroke-0.6.0/actiondb.cc.gspawnasync easystroke-0.6.0/actiondb.cc
--- easystroke-0.6.0/actiondb.cc.gspawnasync	2019-10-18 14:49:14.782420849 -0400
+++ easystroke-0.6.0/actiondb.cc	2019-10-18 14:50:42.034827066 -0400
@@ -119,14 +119,9 @@ template<class Archive> void StrokeInfo:
 using namespace std;
 
 void Command::run() {
-	pid_t pid = fork();
-	switch (pid) {
-		case 0:
-			execlp("/bin/sh", "sh", "-c", cmd.c_str(), nullptr);
-			exit(1);
-		case -1:
-			printf(_("Error: can't execute command \"%s\": fork() failed\n"), cmd.c_str());
-	}
+	gchar* argv[] = {(gchar*) "/bin/sh", (gchar*) "-c", nullptr, nullptr};
+	argv[2] = (gchar *) cmd.c_str();
+	g_spawn_async(nullptr, argv, nullptr, G_SPAWN_SEARCH_PATH, nullptr, nullptr, nullptr, nullptr);
 }
 
 ButtonInfo Button::get_button_info() const {