1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-26 20:01:15 +02:00

* Some hackery to propagate the worker's stderr and exceptions to the

client.
This commit is contained in:
Eelco Dolstra 2006-12-03 02:08:13 +00:00
parent 714fa24cfb
commit 7951c3c546
7 changed files with 209 additions and 107 deletions

View file

@ -437,7 +437,7 @@ 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();
writeFull(STDERR_FILENO, (const unsigned char *) s.c_str(), s.size());
writeToStderr((const unsigned char *) s.c_str(), s.size());
}
@ -450,6 +450,15 @@ void warnOnce(bool & haveWarned, const format & f)
}
static void defaultWriteToStderr(const unsigned char * buf, size_t count)
{
writeFull(STDERR_FILENO, buf, count);
}
void (*writeToStderr) (const unsigned char * buf, size_t count) = defaultWriteToStderr;
void readFull(int fd, unsigned char * buf, size_t count)
{
while (count) {