From: Olivier Matz Date: Thu, 27 Oct 2011 20:45:02 +0000 (+0200) Subject: cmdline: break the interact loop if it returns EOF X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=52e1d5772d1f465a013e65b8ae6e43a027438ed6;p=libcmdline.git cmdline: break the interact loop if it returns EOF Signed-off-by: Olivier Matz --- diff --git a/src/lib/cmdline.c b/src/lib/cmdline.c index 70267de..b0fee32 100644 --- a/src/lib/cmdline.c +++ b/src/lib/cmdline.c @@ -225,7 +225,7 @@ cmdline_interact(struct cmdline *cl) c = -1; while (1) { - if (read(cl->s_in, &c, 1) < 0) + if (read(cl->s_in, &c, 1) <= 0) break; if (cmdline_in(cl, &c, 1) < 0) break;