summary refs log tree commit diff
path: root/src/libutil
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2013-06-07 15:02:14 +0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2013-06-07 15:02:14 +0200
commit5959c591a0a6000b6de14eaec37e8139e36dfe0a (patch)
tree594766e6597e63b694e3fdc65c8740e1cbf0f64e /src/libutil
parentc5f9d0d08058bca4af0d22e8d46a7d84627c0aae (diff)
downloadguix-5959c591a0a6000b6de14eaec37e8139e36dfe0a.tar.gz
Process stderr from substituters while doing have/info queries
Diffstat (limited to 'src/libutil')
-rw-r--r--src/libutil/serialise.cc6
-rw-r--r--src/libutil/serialise.hh2
2 files changed, 8 insertions, 0 deletions
diff --git a/src/libutil/serialise.cc b/src/libutil/serialise.cc
index 9270806a77..1f817a8695 100644
--- a/src/libutil/serialise.cc
+++ b/src/libutil/serialise.cc
@@ -90,6 +90,12 @@ size_t BufferedSource::read(unsigned char * data, size_t len)
 }
 
 
+bool BufferedSource::hasData()
+{
+    return bufPosOut < bufPosIn;
+}
+
+
 size_t FdSource::readUnbuffered(unsigned char * data, size_t len)
 {
     ssize_t n;
diff --git a/src/libutil/serialise.hh b/src/libutil/serialise.hh
index 42dd271176..e1c4514dbb 100644
--- a/src/libutil/serialise.hh
+++ b/src/libutil/serialise.hh
@@ -63,6 +63,8 @@ struct BufferedSource : Source
     
     /* Underlying read call, to be overriden. */
     virtual size_t readUnbuffered(unsigned char * data, size_t len) = 0;
+
+    bool hasData();
 };