From 0e783e557941f77d5b4bcf2a6c6423ed583991a2 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 19 Jun 2006 14:37:35 +0000 Subject: [PATCH] * Write messages to stderr in a slightly more atomic way. Useful when there are several parallel processes. --- src/libutil/util.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libutil/util.cc b/src/libutil/util.cc index 556c3c3a2..973443cf1 100644 --- a/src/libutil/util.cc +++ b/src/libutil/util.cc @@ -401,7 +401,8 @@ void printMsg_(Verbosity level, const format & f) prefix += "| "; else if (logType == ltEscapes && level != lvlInfo) prefix = "\033[" + escVerbosity(level) + "s"; - cerr << format("%1%%2%\n") % prefix % f.str(); + string s = (format("%1%%2%\n") % prefix % f.str()).str(); + writeFull(STDERR_FILENO, (const unsigned char *) s.c_str(), s.size()); }