From d787285af997a607bb678f39f340e663fafd3122 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 13 Dec 2010 16:53:23 +0000 Subject: * 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. --- src/libutil/types.hh | 5 +++-- src/libutil/util.cc | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'src/libutil') 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(); } -- cgit 1.4.1