summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPixel <pixel@nobis-crew.org>2011-11-25 00:04:55 -0800
committerPixel <pixel@nobis-crew.org>2011-11-25 00:04:55 -0800
commitef6356cf6453f8bf624369942ed57769f80c087a (patch)
treeaace8d3d3db0648f774b957a3276e3534ede98e6 /src
parent9329e059b2e560cb3222cee8f8fcf0906de2cf73 (diff)
We need the buffered streams to be detacheable
Diffstat (limited to 'src')
-rw-r--r--src/BStream.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/BStream.cc b/src/BStream.cc
index a27cbc5..89e38b0 100644
--- a/src/BStream.cc
+++ b/src/BStream.cc
@@ -11,14 +11,15 @@ Balau::BStream::BStream(const IO<Handle> & h) : m_h(h), m_buffer((uint8_t *) mal
}
void Balau::BStream::close() throw (Balau::GeneralException) {
- m_h->close();
+ if (!m_detached)
+ m_h->close();
free(m_buffer);
m_availBytes = 0;
m_cursor = 0;
}
-bool Balau::BStream::isClosed() { return m_h->isClosed(); }
-bool Balau::BStream::isEOF() { return m_availBytes == 0 && m_h->isEOF(); }
+bool Balau::BStream::isClosed() { return m_closed || m_h->isClosed(); }
+bool Balau::BStream::isEOF() { return (m_availBytes == 0) && m_h->isEOF(); }
bool Balau::BStream::canRead() { return true; }
const char * Balau::BStream::getName() { return m_name.to_charp(); }
off_t Balau::BStream::getSize() { return m_h->getSize(); }