about summary refs log tree commit diff
path: root/src/libstore/normalise.cc
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2004-06-22T08·50+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2004-06-22T08·50+0000
commitc4cb6ea2bc77f1f9239ce81ffc7a0fa6b540b1ab (patch)
tree73883262549f10206cc2a961dc7fb577f0ba1679 /src/libstore/normalise.cc
parent88fb4f6e537ebea37fe0aaa4a2b044cf70d32178 (diff)
* Refactoring.
Diffstat (limited to 'src/libstore/normalise.cc')
-rw-r--r--src/libstore/normalise.cc24
1 files changed, 5 insertions, 19 deletions
diff --git a/src/libstore/normalise.cc b/src/libstore/normalise.cc
index 937dbc7f9b..29a6c339cb 100644
--- a/src/libstore/normalise.cc
+++ b/src/libstore/normalise.cc
@@ -497,14 +497,8 @@ void NormalisationGoal::buildDone()
     /* Check the exit status. */
     if (!WIFEXITED(status) || WEXITSTATUS(status) != 0) {
         deleteTmpDir(false);
-        if (WIFEXITED(status))
-            throw Error(format("builder for `%1%' failed with exit code %2%")
-                % nePath % WEXITSTATUS(status));
-        else if (WIFSIGNALED(status))
-            throw Error(format("builder for `%1%' failed due to signal %2%")
-                % nePath % WTERMSIG(status));
-        else
-            throw Error(format("builder for `%1%' failed died abnormally") % nePath);
+        throw Error(format("builder for `%1%' %2%")
+            % nePath % statusToString(status));
     }
     
     deleteTmpDir(true);
@@ -1425,17 +1419,9 @@ void SubstitutionGoal::finished()
     debug(format("substitute for `%1%' finished") % storePath);
 
     /* Check the exit status. */
-    /* !!! cut & paste */
-    if (!WIFEXITED(status) || WEXITSTATUS(status) != 0) {
-        if (WIFEXITED(status))
-            throw Error(format("builder for `%1%' failed with exit code %2%")
-                % storePath % WEXITSTATUS(status));
-        else if (WIFSIGNALED(status))
-            throw Error(format("builder for `%1%' failed due to signal %2%")
-                % storePath % WTERMSIG(status));
-        else
-            throw Error(format("builder for `%1%' failed died abnormally") % storePath);
-    }
+    if (!WIFEXITED(status) || WEXITSTATUS(status) != 0)
+        throw Error(format("builder for `%1%' %2%")
+            % storePath % statusToString(status));
 
     if (!pathExists(storePath))
         throw Error(format("substitute did not produce path `%1%'") % storePath);