diff options
author | Eelco Dolstra <e.dolstra@tudelft.nl> | 2010-10-04 11:44:47 +0000 |
---|---|---|
committer | Eelco Dolstra <e.dolstra@tudelft.nl> | 2010-10-04 11:44:47 +0000 |
commit | 71dfe4b90bec29075f01cfbc45f8f521535bf460 (patch) | |
tree | 401ac9b86c11b969f97dd4e3b4557b626c638e39 /src | |
parent | e4907411c2d902215d1a18456ce8b0c653650461 (diff) | |
parent | 450837bcc887a47260817611d01c22e35aba92b6 (diff) | |
download | guix-71dfe4b90bec29075f01cfbc45f8f521535bf460.tar.gz |
* Sync with the trunk.
Diffstat (limited to 'src')
-rw-r--r-- | src/libexpr/eval.cc | 2 | ||||
-rw-r--r-- | src/libexpr/eval.hh | 2 | ||||
-rw-r--r-- | src/libutil/util.cc | 11 | ||||
-rw-r--r-- | src/nix-env/nix-env.cc | 1 |
4 files changed, 12 insertions, 4 deletions
diff --git a/src/libexpr/eval.cc b/src/libexpr/eval.cc index 96bda43a32..e55f28822b 100644 --- a/src/libexpr/eval.cc +++ b/src/libexpr/eval.cc @@ -39,7 +39,7 @@ std::ostream & operator << (std::ostream & str, const Value & v) str << v.path; // !!! escaping? break; case tNull: - str << "true"; + str << "null"; break; case tAttrs: { str << "{ "; diff --git a/src/libexpr/eval.hh b/src/libexpr/eval.hh index 03bf43a3b9..c7533479aa 100644 --- a/src/libexpr/eval.hh +++ b/src/libexpr/eval.hh @@ -5,6 +5,7 @@ #include "nixexpr.hh" #include "symbol-table.hh" +#include "hash.hh" typedef union _ATermList * ATermList; @@ -12,7 +13,6 @@ typedef union _ATermList * ATermList; namespace nix { -class Hash; class EvalState; struct Env; struct Value; diff --git a/src/libutil/util.cc b/src/libutil/util.cc index 2d26fc66da..e7c0700cf4 100644 --- a/src/libutil/util.cc +++ b/src/libutil/util.cc @@ -481,7 +481,16 @@ void printMsg_(Verbosity level, const format & f) else if (logType == ltEscapes && level != lvlInfo) prefix = "\033[" + escVerbosity(level) + "s"; string s = (format("%1%%2%\n") % prefix % f.str()).str(); - writeToStderr((const unsigned char *) s.c_str(), s.size()); + try { + writeToStderr((const unsigned char *) s.c_str(), s.size()); + } catch (SysError & e) { + /* Ignore failing writes to stderr if we're in an exception + handler, otherwise throw an exception. We need to ignore + write errors in exception handlers to ensure that cleanup + code runs to completion if the other side of stderr has + been closed unexpectedly. */ + if (!std::uncaught_exception()) throw; + } } diff --git a/src/nix-env/nix-env.cc b/src/nix-env/nix-env.cc index a67ce243a4..47dab0457a 100644 --- a/src/nix-env/nix-env.cc +++ b/src/nix-env/nix-env.cc @@ -270,7 +270,6 @@ static DrvInfos filterBySelector(EvalState & state, const DrvInfos & allElems, d = j->first.system == k->second.first.system ? 0 : j->first.system == thisSystem ? 1 : k->second.first.system == thisSystem ? -1 : 0; - printMsg(lvlError, format("%1% %2% %3% %4%") % j->first.system % k->second.first.system % thisSystem % d); if (d == 0) d = comparePriorities(state, j->first, k->second.first); if (d == 0) |