about summary refs log tree commit diff
path: root/src/libutil/util.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/libutil/util.cc')
-rw-r--r--src/libutil/util.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/libutil/util.cc b/src/libutil/util.cc
index d61b35bdfbe0..edfd26b0b739 100644
--- a/src/libutil/util.cc
+++ b/src/libutil/util.cc
@@ -23,13 +23,13 @@ extern char * * environ;
 namespace nix {
 
 
-Error::Error(const format & f)
+BaseError::BaseError(const format & f)
 {
     err = f.str();
 }
 
 
-Error & Error::addPrefix(const format & f)
+BaseError & BaseError::addPrefix(const format & f)
 {
     err = f.str() + err;
     return *this;
@@ -491,6 +491,7 @@ string drainFD(int fd)
     string result;
     unsigned char buffer[4096];
     while (1) {
+        checkInterrupt();
         ssize_t rd = read(fd, buffer, sizeof buffer);
         if (rd == -1) {
             if (errno != EINTR)
@@ -775,6 +776,8 @@ void killUser(uid_t uid)
 
 string runProgram(Path program, bool searchPath, const Strings & args)
 {
+    checkInterrupt();
+    
     /* Create a pipe. */
     Pipe pipe;
     pipe.create();