]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
lib/pager: Use pager_open/close for pager_redirect
authorTobias Stoeckmann <tobias@stoeckmann.org>
Wed, 4 Feb 2026 20:45:48 +0000 (21:45 +0100)
committerTobias Stoeckmann <tobias@stoeckmann.org>
Wed, 4 Feb 2026 20:45:48 +0000 (21:45 +0100)
Restore original stdout/stderr for pager_redirect as well to support
atexit handlers of parent which might use these descriptors.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
lib/pager.c

index 4fe61ffa21fdf06944647989919a2fbbd86f9650..3cb96dcc3a8d93558f1ae22d5d1a36a08a23d7f0 100644 (file)
@@ -229,9 +229,9 @@ void pager_redirect(void)
        if (pager_process.pid)
                return;         /* already running */
 
-       __setup_pager();
+       pager_open();
 
-       atexit(wait_for_pager);
+       atexit(pager_close);
 }
 
 /* Setup pager and redirect output, the pager may be closed by pager_close().