Send stderr of commands to the pager.

This is a follow-up to 61b80509e3.

Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
This commit is contained in:
Johannes Sixt
2008-02-26 10:43:45 +01:00
parent bdb6d4ec8e
commit 43d0446323

View File

@@ -34,7 +34,10 @@ static struct child_process pager_process = {
static void wait_for_pager(void)
{
fflush(stdout);
close(1); /* signals EOF to pager */
fflush(stderr);
/* signal EOF to pager */
close(1);
close(2);
finish_command(&pager_process);
}
#endif
@@ -99,6 +102,7 @@ void setup_pager(void)
/* original process continues, but writes to the pipe */
dup2(pager_process.in, 1);
dup2(pager_process.in, 2);
close(pager_process.in);
/* this makes sure that the parent terminates after the pager */