From d4af13508dc83e2c6cca3ad5d7f7b07e370d8ab9 Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Thu, 20 Oct 2011 09:16:53 +0200 Subject: [PATCH] log output: Fix of a bug introduced during cleanups --- ucw/shell/logoutput.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ucw/shell/logoutput.c b/ucw/shell/logoutput.c index 64e060ed..3705ce4b 100644 --- a/ucw/shell/logoutput.c +++ b/ucw/shell/logoutput.c @@ -345,8 +345,6 @@ opt_done: DBG("---> [%i, %i] for %i", fd->pipe[0], fd->pipe[1], fd->fdnum); set_cloexec_flag(fd->pipe[0], 1); set_cloexec_flag(fd->pipe[1], 0); - /* Our pipe is created, let fd->fdnum be the reading end. */ - fd->fdnum = fd->pipe[0]; } } @@ -354,6 +352,9 @@ opt_done: main_init(); CLIST_FOR_EACH(struct fds *, fd, filedescriptors) { + /* Our pipe is created, let fd->fdnum be the reading end. */ + if (!loginput) + fd->fdnum = fd->pipe[0]; fd->rio.read_rec_max = max_line + 1; rec_io_add(&fd->rio, fd->fdnum); } -- 2.39.2