From: Timo Kokkonen Date: Fri, 4 Oct 2013 19:52:33 +0000 (+0300) Subject: main: Add missing EOF check to serial read X-Git-Url: http://git.itanic.dy.fi/?p=log-plotter;a=commitdiff_plain;h=14e1f568461b564c1fee79a0256817fc041bc3f2 main: Add missing EOF check to serial read If we got EOF from the serial port, close it and exit. Nothing more to do. Signed-off-by: Timo Kokkonen --- diff --git a/main.c b/main.c index 847a110..dd6c7c0 100644 --- a/main.c +++ b/main.c @@ -55,6 +55,9 @@ int main(int argc, char *argv[]) break; } + if (ret == 0) + break; + ret = write(1, buf, ret); if (read < 0) { perror("write");