From: Martin Mares Date: Thu, 20 Oct 2011 07:16:53 +0000 (+0200) Subject: log output: Fix of a bug introduced during cleanups X-Git-Tag: v5.0~104 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=d4af13508dc83e2c6cca3ad5d7f7b07e370d8ab9;p=libucw.git log output: Fix of a bug introduced during cleanups --- 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); }