From: Reinhard Pfau Date: Fri, 10 Oct 2008 12:51:26 +0000 (+0000) Subject: libsimpleio: (reinhard) bugfix; set flags for fd also when passed to the constructor. X-Git-Tag: v0.3~102 X-Git-Url: http://developer.intra2net.com/git/?a=commitdiff_plain;h=5d394e879a6fb06f67f1fa18bf4bf59f8bbae47f;p=libasyncio libsimpleio: (reinhard) bugfix; set flags for fd also when passed to the constructor. --- 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