From: Cristian Dumitrescu Date: Fri, 23 May 2014 15:21:24 +0000 (+0100) Subject: cmdline: fix infinite loop after EOF X-Git-Tag: spdx-start~10794 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=cd64eeac116d3bb4871d114b105440b4dd11b8e0;p=dpdk.git cmdline: fix infinite loop after EOF Stop on EOF when reading commands from a file or a pipe. Signed-off-by: Cristian Dumitrescu Acked-by: Olivier Matz --- diff --git a/lib/librte_cmdline/cmdline.c b/lib/librte_cmdline/cmdline.c old mode 100644 new mode 100755 index 03a3facbdd..b3dc17cea8 --- a/lib/librte_cmdline/cmdline.c +++ b/lib/librte_cmdline/cmdline.c @@ -256,7 +256,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;