mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-25 20:33:08 +00:00
Split out io_close_t
This commit is contained in:
parent
4e672427bc
commit
f1b375b042
3 changed files with 17 additions and 4 deletions
8
io.cpp
8
io.cpp
|
@ -67,12 +67,14 @@ void io_data_t::print() const
|
|||
case IO_BUFFER:
|
||||
fprintf(stderr, "buffer %p (size %lu)\n", out_buffer_ptr(), out_buffer_size());
|
||||
break;
|
||||
case IO_CLOSE:
|
||||
fprintf(stderr, "close %d\n", fd);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void io_close_t::print() const
|
||||
{
|
||||
fprintf(stderr, "close %d\n", fd);
|
||||
}
|
||||
|
||||
void io_buffer_read(io_data_t *d)
|
||||
{
|
||||
exec_close(d->param1.pipe_fd[1]);
|
||||
|
|
11
io.h
11
io.h
|
@ -116,6 +116,17 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
class io_close_t : public io_data_t
|
||||
{
|
||||
public:
|
||||
io_close_t(int f) :
|
||||
io_data_t(IO_CLOSE, f)
|
||||
{
|
||||
}
|
||||
|
||||
virtual void print() const;
|
||||
};
|
||||
|
||||
class io_chain_t : public std::vector<shared_ptr<io_data_t> >
|
||||
{
|
||||
public:
|
||||
|
|
|
@ -1601,7 +1601,7 @@ void parser_t::parse_job_argument_list(process_t *p,
|
|||
{
|
||||
if (target == L"-")
|
||||
{
|
||||
new_io.reset(new io_data_t(IO_CLOSE, fd));
|
||||
new_io.reset(new io_close_t(fd));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue