X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=gui.c;h=c335250fee77daccc61868963e6135a220337610;hp=cf25cd4588524afa70989c4212dfecd377c8f538;hb=8d7bdabd22ed7750086ca660754d8d881dae3832;hpb=f03f1a8115c0b4dcb0a705d8a686ccf511648f60 diff --git a/gui.c b/gui.c index cf25cd45..c335250f 100644 --- a/gui.c +++ b/gui.c @@ -966,8 +966,15 @@ check_return: */ static int send_output(void) { + int ret; + if (command_pipe < 0) return 0; + ret = mark_fd_nonblocking(command_pipe); + if (ret < 0) { + close(command_pipe); + return ret; + } if (do_select(COMMAND_MODE) >= 0) PARA_INFO_LOG("%s", "command complete"); else @@ -988,7 +995,6 @@ static int client_cmd_cmdline(char *cmd) if (ret < 0) return -1; command_pipe = fds[1]; - mark_fd_nonblocking(command_pipe); return send_output(); } @@ -1004,7 +1010,6 @@ static int display_cmd(char *cmd) if (para_exec_cmdline_pid(&cmd_pid, cmd, fds) < 0) return -1; command_pipe = fds[1]; - mark_fd_nonblocking(command_pipe); return send_output(); }