From 5d394e879a6fb06f67f1fa18bf4bf59f8bbae47f Mon Sep 17 00:00:00 2001 From: Reinhard Pfau Date: Fri, 10 Oct 2008 12:51:26 +0000 Subject: [PATCH] libsimpleio: (reinhard) bugfix; set flags for fd also when passed to the constructor. --- simpleio/simpleio.cpp | 12 ++++++++++-- 1 files changed, 10 insertions(+), 2 deletions(-) diff --git a/simpleio/simpleio.cpp b/simpleio/simpleio.cpp index 53ed78f..9bf0cad 100644 --- a/simpleio/simpleio.cpp +++ b/simpleio/simpleio.cpp @@ -677,8 +677,8 @@ void FilterBase::reset() * @param write_fd the file descriptor which should be used for writing (default -1 for no value) */ IOImplementation::IOImplementation(int read_fd, int write_fd) -: m_read_fd(read_fd) -, m_write_fd(write_fd) +: m_read_fd(-1) +, m_write_fd(-1) , m_eof(false) , m_not_writable(false) , m_input_buffer() @@ -687,6 +687,14 @@ IOImplementation::IOImplementation(int read_fd, int write_fd) , m_marked_for_writing(false) { internal_io::g_io_list().add_item(this); + if (read_fd >= 0) + { + setReadFd( read_fd ); + } + if (write_fd >= 0) + { + setWriteFd( write_fd ); + } } // eo IOImplementation::IOImplementation -- 1.7.1