aboutsummaryrefslogtreecommitdiffhomepage
path: root/reader.cpp
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 /reader.cpp
parent41fc3bcb748efc20e36160f5c361882c854f4baf (diff)
Make io_data_t::fd const
In exec(), pipe_{write,read} no longer get reused.
Diffstat (limited to 'reader.cpp')
-rw-r--r--reader.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/reader.cpp b/reader.cpp
index 92d0aa52..8689fe64 100644
--- a/reader.cpp
+++ b/reader.cpp
@@ -1113,8 +1113,8 @@ static void run_pager(const wcstring &prefix, int is_quoted, const std::vector<c
wcstring prefix_esc;
char *foo;
- shared_ptr<io_buffer_t> in(io_buffer_t::create(true));
- shared_ptr<io_buffer_t> out(io_buffer_t::create(false));
+ shared_ptr<io_buffer_t> in(io_buffer_t::create(true, 3));
+ shared_ptr<io_buffer_t> out(io_buffer_t::create(false, 4));
// The above may fail e.g. if we have too many open fds
if (in.get() == NULL || out.get() == NULL)
@@ -1137,8 +1137,6 @@ static void run_pager(const wcstring &prefix, int is_quoted, const std::vector<c
is_quoted?L"-q":L"",
prefix_esc.c_str());
- in->fd = 3;
-
escaped_separator = escape(COMPLETE_SEP_STR, 1);
for (size_t i=0; i< comp.size(); i++)
@@ -1203,8 +1201,6 @@ static void run_pager(const wcstring &prefix, int is_quoted, const std::vector<c
in->out_buffer_append(foo, strlen(foo));
free(foo);
- out->fd = 4;
-
term_donate();
parser_t &parser = parser_t::principal_parser();
io_chain_t io_chain;