external_cmd() calls this function to execute the given command.
However, as para_exec_cmdline_pid() may fail, e.g. because the
underlying call to fork() failed due to hitting the RLIMIT_NPROC
resource limit, we must check the return value. The other two command
dispatchers got this right, but external_cmd() did not.
if (cmd_pid)
return;
shutdown_curses();
- para_exec_cmdline_pid(&cmd_pid, cmd, fds);
+ if (para_exec_cmdline_pid(&cmd_pid, cmd, fds) < 0)
+ return;
cmd_died = 0;
do_select(EXTERNAL_MODE);
init_curses();