cmdline: break the interact loop if it returns EOF
authorOlivier Matz <zer0@droids-corp.org>
Thu, 27 Oct 2011 20:45:02 +0000 (22:45 +0200)
committerOlivier Matz <zer0@droids-corp.org>
Thu, 27 Oct 2011 20:46:56 +0000 (22:46 +0200)
Signed-off-by: Olivier Matz <zer0@droids-corp.org>
src/lib/cmdline.c

index 70267de..b0fee32 100644 (file)
@@ -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;