From: Tobias Stoeckmann Date: Mon, 16 Feb 2026 20:54:24 +0000 (+0100) Subject: lib/pager: Drop pager_redirect X-Git-Tag: v2.43-devel~79 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f58ad4717ba3be2f002e2d243a2b26f1f66cf355;p=thirdparty%2Futil-linux.git lib/pager: Drop pager_redirect 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 --- diff --git a/lib/pager.c b/lib/pager.c index df8714da5..38b4af57a 100644 --- a/lib/pager.c +++ b/lib/pager.c @@ -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 */