aboutsummaryrefslogtreecommitdiff
path: root/src/libstore
diff options
context:
space:
mode:
authorShea Levy <shea@shealevy.com>2015-02-04 11:46:38 -0500
committerEelco Dolstra <eelco.dolstra@logicblox.com>2015-02-04 18:15:56 +0100
commitd66d9e8425d52cc698851e2e85bd56aa96f45fc9 (patch)
tree821dead4a5a6d356dd65d81513649be45ce8a774 /src/libstore
parentf3a5930488e4a25de33d9aacc2e14ae614614b5e (diff)
Require linux 3.13 or later for chroot
Fixes #453
Diffstat (limited to 'src/libstore')
-rw-r--r--src/libstore/build.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/libstore/build.cc b/src/libstore/build.cc
index e0398e2fb..259324734 100644
--- a/src/libstore/build.cc
+++ b/src/libstore/build.cc
@@ -1970,7 +1970,12 @@ void DerivationGoal::startBuilder()
char stack[32 * 1024];
pid_t child = clone(childEntry, stack + sizeof(stack) - 8,
CLONE_NEWPID | CLONE_NEWNS | CLONE_NEWNET | CLONE_NEWIPC | CLONE_NEWUTS | CLONE_PARENT | SIGCHLD, this);
- if (child == -1) throw SysError("cloning builder process");
+ if (child == -1) {
+ if (errno == EINVAL)
+ throw SysError("cloning builder process (Linux chroot builds require 3.13 or later)");
+ else
+ throw SysError("cloning builder process");
+ }
writeFull(builderOut.writeSide, int2String(child) + "\n");
_exit(0);
});