about summary refs log tree commit diff
path: root/src/libstore/build.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstore/build.cc')
-rw-r--r--src/libstore/build.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libstore/build.cc b/src/libstore/build.cc
index dd08ce7d771f..0f71e7511512 100644
--- a/src/libstore/build.cc
+++ b/src/libstore/build.cc
@@ -2320,7 +2320,7 @@ void DerivationGoal::startBuilder()
                parent. This is only done when sandbox-fallback is set
                to true (the default). */
             if (child == -1 && (errno == EPERM || errno == EINVAL) && settings.sandboxFallback)
-                _exit(EPERM);
+                _exit(1);
             if (child == -1) throw SysError("cloning builder process");
 
             writeFull(builderOut.writeSide.get(), std::to_string(child) + "\n");
@@ -2328,7 +2328,7 @@ void DerivationGoal::startBuilder()
         }, options);
 
         int res = helper.wait();
-        if (res == EPERM && settings.sandboxFallback) {
+        if (res != 0 && settings.sandboxFallback) {
             useChroot = false;
             goto fallback;
         } else if (res != 0)