chiark / gitweb /
improve readability (#5814)
authorMatija Skala <mskala@gmx.com>
Thu, 27 Apr 2017 00:08:52 +0000 (02:08 +0200)
committerSven Eden <yamakuzure@gmx.net>
Tue, 25 Jul 2017 07:46:52 +0000 (09:46 +0200)
src/shared/pager.c

index e792381..8f3fc13 100644 (file)
@@ -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;