浏览代码

Actually close the stdout pipe on error in process_unix_exec

When cleaning up after an error in process_unix_exec, the stdin
pipe was being double closed instead of closing both the stdin
and stdout pipes.  This occurred in two places.

Signed-off-by: Kris Katterjohn <katterjohn@gmail.com>
Kris Katterjohn 5 年之前
父节点
当前提交
df1a8a657e
共有 1 个文件被更改,包括 4 次插入4 次删除
  1. 4 4
      src/lib/process/process_unix.c

+ 4 - 4
src/lib/process/process_unix.c

@@ -183,8 +183,8 @@ process_unix_exec(process_t *process)
     close(stdin_pipe[1]);
 
     /** Cleanup standard out pipe. */
-    close(stdin_pipe[0]);
-    close(stdin_pipe[1]);
+    close(stdout_pipe[0]);
+    close(stdout_pipe[1]);
 
     return PROCESS_STATUS_ERROR;
   }
@@ -281,8 +281,8 @@ process_unix_exec(process_t *process)
     close(stdin_pipe[1]);
 
     /** Cleanup standard out pipe. */
-    close(stdin_pipe[0]);
-    close(stdin_pipe[1]);
+    close(stdout_pipe[0]);
+    close(stdout_pipe[1]);
 
     /** Cleanup standard error pipe. */
     close(stderr_pipe[0]);