about summary refs log tree commit diff
path: root/src/libstore/build.cc
diff options
context:
space:
mode:
authorDaiderd Jordan <daiderd@gmail.com>2019-06-15T13·28+0200
committerDaiderd Jordan <daiderd@gmail.com>2019-07-01T22·12+0200
commita52c331edba6e8c67469f53dda0be2903d18fa8c (patch)
tree55e835606fe910a205a71b47208794ebdaaeed2c /src/libstore/build.cc
parent1ac399dd115d5c86629389e0cdfefa0d654fc90a (diff)
build: replace 100 offset for build exit codes
Diffstat (limited to 'src/libstore/build.cc')
-rw-r--r--src/libstore/build.cc24
1 files changed, 19 insertions, 5 deletions
diff --git a/src/libstore/build.cc b/src/libstore/build.cc
index abfae3c7cf64..350ac4092854 100644
--- a/src/libstore/build.cc
+++ b/src/libstore/build.cc
@@ -4471,15 +4471,29 @@ void Worker::waitForInput()
 
 unsigned int Worker::exitStatus()
 {
+    /*
+     * 1100100
+     *    ^^^^
+     *    |||`- timeout
+     *    ||`-- output hash mismatch
+     *    |`--- build failure
+     *    `---- not deterministic
+     */
     unsigned int mask = 0;
+    bool buildFailure = permanentFailure || timedOut || hashMismatch;
+    if (buildFailure)
+        mask |= 0x04;  // 100
     if (timedOut)
-        mask |= 1;
+        mask |= 0x01;  // 101
     if (hashMismatch)
-        mask |= 2;
-    if (checkMismatch)
-        mask |= 4;
+        mask |= 0x02;  // 102
+    if (checkMismatch) {
+        mask |= 0x08;  // 104
+    }
 
-    return mask ? 100 + mask : 1;
+    if (mask)
+        mask |= 0x60;
+    return mask ? mask : 1;
 }