We might as well directly refer to cmd_pid which is set to zero in the
signal handling code after the process exits.
static unsigned scroll_position;
-static int cmd_died, curses_active;
+static int curses_active;
static pid_t cmd_pid;
static int command_fds[2];
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;
}
return ret;
break;
case EXTERNAL_MODE:
- if (cmd_died) {
- cmd_died = 0;
+ if (cmd_pid == 0)
return 0;
- }
}
goto repeat;
}
shutdown_curses();
if (para_exec_cmdline_pid(&cmd_pid, cmd, fds) < 0)
return;
- cmd_died = 0;
do_select(EXTERNAL_MODE);
init_curses();
}