summaryrefslogtreecommitdiff
path: root/src/shared/pager.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2017-04-27 13:39:54 -0400
committerGitHub <noreply@github.com>2017-04-27 13:39:54 -0400
commit0bc9115251f1bf12a9b15cc7f0bf59cf450ab9c0 (patch)
tree83d6eba6ace443a0ca6cbde99d05df9501d2c3b8 /src/shared/pager.c
parent34ce0a52c733bd667049e1a54696c2e5b983d615 (diff)
parent00a313261e840efcf8e82031e46a31918b49a74d (diff)
Merge branch 'master' into meson-no-libudev
Diffstat (limited to 'src/shared/pager.c')
-rw-r--r--src/shared/pager.c10
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;