From ef0508ee41853a36a60676714ff1deecf9bb930d Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Mon, 25 Mar 2013 02:22:24 +0000 Subject: [PATCH] gui: Remove superfluous cmd_died. We might as well directly refer to cmd_pid which is set to zero in the signal handling code after the process exits. --- gui.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/gui.c b/gui.c index 9ac24ab6..68a271a8 100644 --- a/gui.c +++ b/gui.c @@ -50,7 +50,7 @@ static struct ringbuffer *bot_win_rb; static unsigned scroll_position; -static int cmd_died, curses_active; +static int curses_active; static pid_t cmd_pid; static int command_fds[2]; @@ -834,10 +834,8 @@ reap_next_child: ret = para_reap_child(&pid); if (ret <= 0) return; - if (pid == cmd_pid) { + if (pid == cmd_pid) cmd_pid = 0; - cmd_died = 1; - } goto reap_next_child; } @@ -1066,10 +1064,8 @@ check_return: return ret; break; case EXTERNAL_MODE: - if (cmd_died) { - cmd_died = 0; + if (cmd_pid == 0) return 0; - } } goto repeat; } @@ -1143,7 +1139,6 @@ static void external_cmd(char *cmd) shutdown_curses(); if (para_exec_cmdline_pid(&cmd_pid, cmd, fds) < 0) return; - cmd_died = 0; do_select(EXTERNAL_MODE); init_curses(); } -- 2.39.2