summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarcus Fritzsch <marcus_fritzsch@mentor.com>2017-06-30 15:58:45 +0200
committerMarcus Fritzsch <marcus_fritzsch@mentor.com>2017-08-08 17:24:00 +0200
commit1f3e4103df53cc0d0946cd712165877bae8a2c2d (patch)
tree272a5f1bf92278a74f4754ef9b08822119af92fe /src
parent8c712205657ceceb8644065735b5fff06bedfbb5 (diff)
main: read only once from stdin for status log
Signed-off-by: Marcus Fritzsch <marcus_fritzsch@mentor.com>
Diffstat (limited to 'src')
-rw-r--r--src/main.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 8dde449..fbd4e46 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -173,9 +173,7 @@ int main(int /*argc*/, char ** /*argv*/) {
p.add_fd(STDIN_FILENO, [&c](int fd) {
int buf;
ssize_t ret;
- while ((ret = read(fd, &buf, sizeof(buf))) == sizeof(buf)) {
- ;
- }
+ ret = read(fd, &buf, sizeof(buf));
c.c->debug_dump_current_status();
return ret == 0 ? -1 : 0;
});