diff options
author | Daiderd Jordan <daiderd@gmail.com> | 2019-05-11 23:14:19 +0200 |
---|---|---|
committer | Daiderd Jordan <daiderd@gmail.com> | 2019-07-02 00:12:38 +0200 |
commit | cbf84bcce7d3fddb353d3aa0f012f5cbdbb77629 (patch) | |
tree | 290af8246890df76bcd9e48cb69537192a62ec87 | |
parent | 97baf32fbca13101f58d30bb3a601302c3d560f3 (diff) |
build: use binary mask for build status flags
If multiple builds with fail with different errors it will be reflected
in the status code.
eg.
103 => timeout + hash mismatch
105 => timeout + check mismatch
106 => hash mismatch + check mismatch
107 => timeout + hash mismatch + check mismatch
-rw-r--r-- | src/libstore/build.cc | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/libstore/build.cc b/src/libstore/build.cc index c076ea8b0..abfae3c7c 100644 --- a/src/libstore/build.cc +++ b/src/libstore/build.cc @@ -4471,7 +4471,15 @@ void Worker::waitForInput() unsigned int Worker::exitStatus() { - return checkMismatch ? 104 : (hashMismatch ? 102 : (timedOut ? 101 : (permanentFailure ? 100 : 1))); + unsigned int mask = 0; + if (timedOut) + mask |= 1; + if (hashMismatch) + mask |= 2; + if (checkMismatch) + mask |= 4; + + return mask ? 100 + mask : 1; } |