summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Smeding <tom.smeding@gmail.com>2018-09-17 22:59:31 +0200
committerTom Smeding <tom.smeding@gmail.com>2018-09-17 22:59:31 +0200
commit44182a1be82d5e5df6f7b1a3c85dd7386b397007 (patch)
treec3667f260fe444641dd581b9489111a32a43015d
parentb9fe622b6f3b3a0abba1eee0d71285c7329c89d2 (diff)
A few useful error logs in process.cpp
-rw-r--r--process.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/process.cpp b/process.cpp
index cab5484..d245449 100644
--- a/process.cpp
+++ b/process.cpp
@@ -111,7 +111,10 @@ bool Process::writeLine(const string_view line) {
}
optional<string> Process::readLine() {
- if (pid == -1) return nullopt;
+ if (pid == -1) {
+ cerr << "-- readLine on pid==-1 --" << endl;
+ return nullopt;
+ }
size_t idx = readBuf.find('\n');
if (idx != string::npos) {
@@ -129,6 +132,7 @@ optional<string> Process::readLine() {
return nullopt;
}
if (nr == 0) { // EOF
+ cerr << "-- eof in readLine --" << endl;
return nullopt;
}
s.resize(nr);