diff options
| author | Ludovic Courtès <ludo@gnu.org> | 2015-01-05 22:51:03 +0100 |
|---|---|---|
| committer | Ludovic Courtès <ludo@gnu.org> | 2015-02-07 23:16:56 +0100 |
| commit | 9ba0b8d3d09a83c03ea3e296239e5e8c986a6bb7 (patch) | |
| tree | dd20166fbc0ffb03c66ff536986ad02f026792cc | |
| parent | 46b8aadbd6f4673aad27f6425f48a3b3ac5c88dc (diff) | |
daemon: Flush upon '\r' when reading the substituter's stderr.
* nix/libstore/local-store.cc (LocalStore::getLineFromSubstituter):
Flush when the line contains '\r'.
| -rw-r--r-- | nix/libstore/local-store.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/nix/libstore/local-store.cc b/nix/libstore/local-store.cc index 5d210ae0171..2c3d65215cb 100644 --- a/nix/libstore/local-store.cc +++ b/nix/libstore/local-store.cc | |||
| @@ -1168,8 +1168,10 @@ string LocalStore::getLineFromSubstituter(RunningSubstituter & run) | |||
| 1168 | if (n == 0) throw EndOfFile(format("substituter `%1%' died unexpectedly") % run.program); | 1168 | if (n == 0) throw EndOfFile(format("substituter `%1%' died unexpectedly") % run.program); |
| 1169 | err.append(buf, n); | 1169 | err.append(buf, n); |
| 1170 | string::size_type p; | 1170 | string::size_type p; |
| 1171 | while ((p = err.find('\n')) != string::npos) { | 1171 | while (((p = err.find('\n')) != string::npos) |
| 1172 | printMsg(lvlError, run.program + ": " + string(err, 0, p)); | 1172 | || ((p = err.find('\r')) != string::npos)) { |
| 1173 | string thing(err, 0, p + 1); | ||
| 1174 | writeToStderr(run.program + ": " + thing); | ||
| 1173 | err = string(err, p + 1); | 1175 | err = string(err, p + 1); |
| 1174 | } | 1176 | } |
| 1175 | } | 1177 | } |
