aboutsummaryrefslogtreecommitdiffhomepage
path: root/io.h
diff options
context:
space:
mode:
authorGravatar Cheer Xiao <xiaqqaix@gmail.com>2013-02-04 20:07:16 +0800
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2013-02-11 22:05:47 -0800
commit3f9706a7f350fcac43fc389b0b52b3601269e2e9 (patch)
tree7bc25f1a6bbbdf66ec56aaf5bc2c321dda45f879 /io.h
parent41fc3bcb748efc20e36160f5c361882c854f4baf (diff)
Make io_data_t::fd const
In exec(), pipe_{write,read} no longer get reused.
Diffstat (limited to 'io.h')
-rw-r--r--io.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/io.h b/io.h
index b007bbf6..a156c0e1 100644
--- a/io.h
+++ b/io.h
@@ -32,7 +32,7 @@ public:
/** Type of redirect */
const io_mode_t io_mode;
/** FD to redirect */
- int fd;
+ const int fd;
virtual void print() const = 0;
virtual ~io_data_t() = 0;
@@ -167,8 +167,10 @@ public:
\param is_input set this parameter to zero if the buffer should be
used to buffer the output of a command, or non-zero to buffer the
input to a command.
+
+ \param fd when -1, determined from is_input.
*/
- static io_buffer_t *create(bool is_input);
+ static io_buffer_t *create(bool is_input, int fd = -1);
};
class io_chain_t : public std::vector<shared_ptr<io_data_t> >