static pid_t pager_pid = 0;
-_noreturn_ static void pager_fallback(void) {
+noreturn static void pager_fallback(void) {
ssize_t n;
+
do {
n = splice(STDIN_FILENO, NULL, STDOUT_FILENO, NULL, 64*1024, 0);
} while (n > 0);
+
if (n < 0) {
log_error("Internal pager failed: %m");
_exit(EXIT_FAILURE);
}
+
_exit(EXIT_SUCCESS);
}
close_pipe(fd);
if (jump_to_end)
- setenv("LESS", "FRSXK+G", 0);
+ setenv("LESS", "FRSXMK+G", 1);
else
- setenv("LESS", "FRSXK", 0);
+ setenv("LESS", "FRSXMK", 1);
/* Make sure the pager goes away when the parent dies */
if (prctl(PR_SET_PDEATHSIG, SIGTERM) < 0)