From e32d2342a6ecf529ae696a64c2aafab97204ff5d Mon Sep 17 00:00:00 2001 From: o9000 Date: Thu, 27 Apr 2017 21:57:45 +0200 Subject: [PATCH] Fix regression in executor (issue #639) --- src/execplugin/execplugin.c | 4 +++- src/util/common.c | 7 ++++--- src/util/common.h | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/execplugin/execplugin.c b/src/execplugin/execplugin.c index e7656d1..f176f1d 100644 --- a/src/execplugin/execplugin.c +++ b/src/execplugin/execplugin.c @@ -588,8 +588,10 @@ void execp_action(void *obj, int button, int x, int y, Time time) execp->area.width, execp->area.height, command); - tint_exec(full_cmd, NULL, NULL, time); + pid_t pid = tint_exec(full_cmd, NULL, NULL, time); g_free(full_cmd); + if (pid > 0) + g_tree_insert(execp->backend->cmd_pids, GINT_TO_POINTER(pid), GINT_TO_POINTER(1)); } else { execp_force_update(execp); } diff --git a/src/util/common.c b/src/util/common.c index 09f34d7..43ea6a8 100644 --- a/src/util/common.c +++ b/src/util/common.c @@ -103,17 +103,17 @@ gboolean parse_line(const char *line, char **key, char **value) extern char *config_path; -void tint_exec(const char *command, const char *dir, const char *tooltip, Time time) +pid_t tint_exec(const char *command, const char *dir, const char *tooltip, Time time) { if (!command || strlen(command) == 0) - return; + return -1; command = g_strdup_printf("export TINT2_CONFIG=%s;" "%s", config_path, command); if (!command) - return; + return -1; if (!tooltip) tooltip = command; @@ -160,6 +160,7 @@ void tint_exec(const char *command, const char *dir, const char *tooltip, Time t } #endif // HAVE_SN } + return pid; } void tint_exec_no_sn(const char *command) diff --git a/src/util/common.h b/src/util/common.h index 676cfa0..c1f72d2 100644 --- a/src/util/common.h +++ b/src/util/common.h @@ -54,7 +54,7 @@ void extract_values(const char *value, char **value1, char **value2, char **valu void extract_values_4(const char *value, char **value1, char **value2, char **value3, char **value4); // Executes a command in a shell. -void tint_exec(const char *command, const char *dir, const char *tooltip, Time time); +pid_t tint_exec(const char *command, const char *dir, const char *tooltip, Time time); void tint_exec_no_sn(const char *command); // Returns a copy of s in which "~" is expanded to the path to the user's home directory.