about summary refs log tree commit diff
path: root/src/nix-worker/nix-worker.cc
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2010-12-17T11·28+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2010-12-17T11·28+0000
commitb1eb25217217087cb70a730da5311bd0890cf6ad (patch)
treea95273ff41849891960d878d9935bb82771bafcd /src/nix-worker/nix-worker.cc
parenteac93d6efeba68d9da95f01e10cd859eef6d85dd (diff)
* Propagate the "100" exit status for failed builds through the Nix
  daemon.

Diffstat (limited to 'src/nix-worker/nix-worker.cc')
-rw-r--r--src/nix-worker/nix-worker.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/nix-worker/nix-worker.cc b/src/nix-worker/nix-worker.cc
index ec5ca58aa0d1..0fa1b40aede9 100644
--- a/src/nix-worker/nix-worker.cc
+++ b/src/nix-worker/nix-worker.cc
@@ -178,7 +178,7 @@ static void startWork()
 
 /* stopWork() means that we're done; stop sending stderr to the
    client. */
-static void stopWork(bool success = true, const string & msg = "")
+static void stopWork(bool success = true, const string & msg = "", unsigned int status = 0)
 {
     /* Stop handling async client death; we're going to a state where
        we're either sending or receiving from the client, so we'll be
@@ -192,6 +192,7 @@ static void stopWork(bool success = true, const string & msg = "")
     else {
         writeInt(STDERR_ERROR, to);
         writeString(msg, to);
+        if (status != 0) writeInt(status, to);
     }
 }
 
@@ -637,7 +638,7 @@ static void processConnection()
         try {
             performOp(clientVersion, from, to, op);
         } catch (Error & e) {
-            stopWork(false, e.msg());
+            stopWork(false, e.msg(), GET_PROTOCOL_MINOR(clientVersion) >= 8 ? e.status : 0);
         }
 
         assert(!canSendStderr);