about summary refs log tree commit diff
path: root/src/libutil
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2010-12-13T16·53+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2010-12-13T16·53+0000
commitd787285af997a607bb678f39f340e663fafd3122 (patch)
tree42eecd29e47fdcf52f673ac0d5020d8d76ad8592 /src/libutil
parent5833243c92f28759ff0fc1ff9266535a3230e2d6 (diff)
* nix-instantiate: return exit status 100 to denote a permanent build
  failure.  The build hook can use this to distinguish between
  transient and permanent failures on the remote side.

Diffstat (limited to 'src/libutil')
-rw-r--r--src/libutil/types.hh5
-rw-r--r--src/libutil/util.cc3
2 files changed, 5 insertions, 3 deletions
diff --git a/src/libutil/types.hh b/src/libutil/types.hh
index 854a0f689a14..533fcca22eb0 100644
--- a/src/libutil/types.hh
+++ b/src/libutil/types.hh
@@ -29,7 +29,8 @@ protected:
     string prefix_; // used for location traces etc.
     string err;
 public:
-    BaseError(const format & f);
+    unsigned int status; // exit status
+    BaseError(const format & f, unsigned int status = 1);
     ~BaseError() throw () { };
     const char * what() const throw () { return err.c_str(); }
     const string & msg() const throw () { return err; }
@@ -41,7 +42,7 @@ public:
     class newClass : public superClass                  \
     {                                                   \
     public:                                             \
-        newClass(const format & f) : superClass(f) { }; \
+        newClass(const format & f, unsigned int status = 1) : superClass(f, status) { }; \
     };
 
 MakeError(Error, BaseError)
diff --git a/src/libutil/util.cc b/src/libutil/util.cc
index 990962763e1f..9adaac40d56e 100644
--- a/src/libutil/util.cc
+++ b/src/libutil/util.cc
@@ -20,7 +20,8 @@ extern char * * environ;
 namespace nix {
 
 
-BaseError::BaseError(const format & f)
+BaseError::BaseError(const format & f, unsigned int status)
+    : status(status)
 {
     err = f.str();
 }