From 371f67f1b567a08d5b9f62c97ae5a619a5051420 Mon Sep 17 00:00:00 2001 From: ridiculousfish Date: Thu, 31 Jan 2019 17:58:59 -0800 Subject: [PATCH] Remove pipe_read_fd In practice it was always STDIN_FILENO. --- src/exec.cpp | 2 +- src/proc.h | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/exec.cpp b/src/exec.cpp index d180ef826..c6115c477 100644 --- a/src/exec.cpp +++ b/src/exec.cpp @@ -902,7 +902,7 @@ static bool exec_process_in_job(parser_t &parser, process_t *p, std::shared_ptr< // Read pipe goes last. if (!p->is_first_in_job) { - pipe_read.reset(new io_pipe_t(p->pipe_read_fd, true)); + pipe_read.reset(new io_pipe_t(STDIN_FILENO, true)); // Record the current read in pipe_read. pipe_read->pipe_fd[0] = pipe_current_read.fd(); process_net_io_chain.push_back(pipe_read); diff --git a/src/proc.h b/src/proc.h index b48e5d215..1620e4e5b 100644 --- a/src/proc.h +++ b/src/proc.h @@ -118,8 +118,6 @@ class process_t { pid_t pid{0}; /// File descriptor that pipe output should bind to. int pipe_write_fd{0}; - /// File descriptor that the _next_ process pipe input should bind to. - int pipe_read_fd{0}; /// True if process has completed. volatile int completed{false}; /// True if process has stopped.