about summary refs log tree commit diff
path: root/src/libstore/build.cc
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2012-06-27T13·52-0400
committerEelco Dolstra <eelco.dolstra@logicblox.com>2012-06-27T13·52-0400
commit3ee208516fbdd302b178d68a20dd44517a276a96 (patch)
tree240476ad3d05f5ae99dc9358018f945dc9a09548 /src/libstore/build.cc
parent1db38ae81bd91d781ece9c0cfb995e743e68e951 (diff)
Check the return code of the clone() call
Diffstat (limited to 'src/libstore/build.cc')
-rw-r--r--src/libstore/build.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libstore/build.cc b/src/libstore/build.cc
index f09437c6b3..e7a8ee434a 100644
--- a/src/libstore/build.cc
+++ b/src/libstore/build.cc
@@ -1806,9 +1806,10 @@ void DerivationGoal::startBuilder()
     {
         pid = fork();
         if (pid == 0) initChild();
-        else if (pid == -1) throw SysError("unable to fork");
     }
 
+    if (pid == -1) throw SysError("unable to fork");
+
     /* parent */
     pid.setSeparatePG(true);
     builderOut.writeSide.close();