diff options
author | 2013-01-15 17:10:40 +0800 | |
---|---|---|
committer | 2013-01-17 15:55:05 +0800 | |
commit | e020ad0c068861325dca1655cb0ed487a22b67c5 (patch) | |
tree | d85c95a931bd61ff11de9dddfddf466cde60c155 /io.cpp | |
parent | df0c1eb32c93ea72318f351c4c5867b8bbf47caf (diff) |
Convert io_buffer_read to io_buffer_t::read
Diffstat (limited to 'io.cpp')
-rw-r--r-- | io.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
@@ -81,23 +81,23 @@ void io_buffer_t::print() const fprintf(stderr, "buffer %p (size %lu)\n", out_buffer_ptr(), out_buffer_size()); } -void io_buffer_read(io_buffer_t *d) +void io_buffer_t::read() { - exec_close(d->param1.pipe_fd[1]); + exec_close(param1.pipe_fd[1]); - if (d->io_mode == IO_BUFFER) + if (io_mode == IO_BUFFER) { - /* if( fcntl( d->param1.pipe_fd[0], F_SETFL, 0 ) ) + /* if( fcntl( param1.pipe_fd[0], F_SETFL, 0 ) ) { wperror( L"fcntl" ); return; } */ - debug(4, L"io_buffer_read: blocking read on fd %d", d->param1.pipe_fd[0]); + debug(4, L"io_buffer_t::read: blocking read on fd %d", param1.pipe_fd[0]); while (1) { char b[4096]; long l; - l=read_blocked(d->param1.pipe_fd[0], b, 4096); + l=read_blocked(param1.pipe_fd[0], b, 4096); if (l==0) { break; @@ -115,15 +115,15 @@ void io_buffer_read(io_buffer_t *d) { debug(1, _(L"An error occured while reading output from code block on file descriptor %d"), - d->param1.pipe_fd[0]); - wperror(L"io_buffer_read"); + param1.pipe_fd[0]); + wperror(L"io_buffer_t::read"); } break; } else { - d->out_buffer_append(b, l); + out_buffer_append(b, l); } } } |