]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
lib/pager: Drop pager_redirect
authorTobias Stoeckmann <tobias@stoeckmann.org>
Mon, 16 Feb 2026 20:54:24 +0000 (21:54 +0100)
committerTobias Stoeckmann <tobias@stoeckmann.org>
Mon, 16 Feb 2026 20:56:24 +0000 (21:56 +0100)
The pager_redirect function was only used in dmesg. Since it is no
longer used there, drop it from lib/pager.c as well.

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

index df8714da540e7b5c6a5ec0bdb1241cc522716b67..38b4af57a0a6eccb9a0d294578ec8413b8fa0eb1 100644 (file)
@@ -223,18 +223,6 @@ static void __setup_pager(void)
        sigaction(SIGPIPE, &sa, &pager_process.orig_sigpipe);
 }
 
-/* Setup pager and redirect output to the $PAGER. The pager is closed at exit.
- */
-void pager_redirect(void)
-{
-       if (pager_process.pid)
-               return;         /* already running */
-
-       pager_open();
-
-       atexit(pager_close);
-}
-
 /* Setup pager and redirect output, the pager may be closed by pager_close().
  */
 void pager_open(void)
@@ -314,9 +302,10 @@ int main(int argc __attribute__ ((__unused__)),
 {
        int i;
 
-       pager_redirect();
+       pager_open();
        for (i = 0; i < MAX; i++)
                printf("%d\n", i);
+       pager_close();
        return EXIT_SUCCESS;
 }
 #endif /* TEST_PROGRAM_PAGER */