diff options
Diffstat (limited to 'src/shared')
-rw-r--r-- | src/shared/pager.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/shared/pager.c b/src/shared/pager.c index 22d7603ec6..4d7b02c63c 100644 --- a/src/shared/pager.c +++ b/src/shared/pager.c @@ -176,12 +176,14 @@ void pager_close(void) { /* Inform pager that we are done */ (void) fflush(stdout); - if (stdout_redirected && ((stored_stdout < 0) || (dup2(stored_stdout, STDOUT_FILENO) < 0))) - (void) close(STDOUT_FILENO); + if (stdout_redirected) + if (stored_stdout < 0 || dup2(stored_stdout, STDOUT_FILENO) < 0) + (void) close(STDOUT_FILENO); stored_stdout = safe_close(stored_stdout); (void) fflush(stderr); - if (stderr_redirected && ((stored_stderr < 0) || (dup2(stored_stderr, STDERR_FILENO) < 0))) - (void) close(STDERR_FILENO); + if (stderr_redirected) + if (stored_stderr < 0 || dup2(stored_stderr, STDERR_FILENO) < 0) + (void) close(STDERR_FILENO); stored_stderr = safe_close(stored_stderr); stdout_redirected = stderr_redirected = false; |