summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Drew DeVault <sir@cmpwn.com>2017-06-12 18:03:25 -0400
committerLibravatar GitHub <noreply@github.com>2017-06-12 18:03:25 -0400
commit16e20ec251b027c5a8dbc5e85804012f2602629d (patch)
treeff1595433f3082b77637b0ba3450e7a2e77ac7f7
parentMerge pull request #1235 from vaartis/patch-1 (diff)
parentswaybar: Group child processes for signalling (diff)
downloadsway-16e20ec251b027c5a8dbc5e85804012f2602629d.tar.gz
sway-16e20ec251b027c5a8dbc5e85804012f2602629d.tar.zst
sway-16e20ec251b027c5a8dbc5e85804012f2602629d.zip
Merge pull request #1236 from ykrivopalov/fix_complex_status_command
swaybar: Group child processes for signalling
-rw-r--r--swaybar/bar.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/swaybar/bar.c b/swaybar/bar.c
index abde1cc9..5ed0d266 100644
--- a/swaybar/bar.c
+++ b/swaybar/bar.c
@@ -34,6 +34,7 @@ static void spawn_status_cmd_proc(struct bar *bar) {
34 close(pipefd[0]); 34 close(pipefd[0]);
35 dup2(pipefd[1], STDOUT_FILENO); 35 dup2(pipefd[1], STDOUT_FILENO);
36 close(pipefd[1]); 36 close(pipefd[1]);
37 setpgid(bar->status_command_pid, 0);
37 char *const cmd[] = { 38 char *const cmd[] = {
38 "sh", 39 "sh",
39 "-c", 40 "-c",
@@ -274,7 +275,7 @@ static void free_outputs(list_t *outputs) {
274static void terminate_status_command(pid_t pid) { 275static void terminate_status_command(pid_t pid) {
275 if (pid) { 276 if (pid) {
276 // terminate status_command process 277 // terminate status_command process
277 int ret = kill(pid, SIGTERM); 278 int ret = killpg(pid, SIGTERM);
278 if (ret != 0) { 279 if (ret != 0) {
279 sway_log(L_ERROR, "Unable to terminate status_command [pid: %d]", pid); 280 sway_log(L_ERROR, "Unable to terminate status_command [pid: %d]", pid);
280 } else { 281 } else {