diff options
author | Lennart Poettering <lennart@poettering.net> | 2015-08-28 00:11:49 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2015-08-28 02:05:51 +0200 |
commit | 6a7c676c54eb205d80f124eeb66c84df3c54d174 (patch) | |
tree | 8aa09bcccabccad4f3eda0509a12b7593d75c5a5 | |
parent | 81d20007f966e36cc8c9161b7117f3f1affdba02 (diff) |
pager: port fallback pager to use copy_bytes()
-rw-r--r-- | src/shared/pager.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/shared/pager.c b/src/shared/pager.c index 13f03e798b..a5454e377d 100644 --- a/src/shared/pager.c +++ b/src/shared/pager.c @@ -31,18 +31,16 @@ #include "macro.h" #include "terminal-util.h" #include "signal-util.h" +#include "copy.h" static pid_t pager_pid = 0; noreturn static void pager_fallback(void) { - ssize_t n; - - do { - n = splice(STDIN_FILENO, NULL, STDOUT_FILENO, NULL, 64*1024, 0); - } while (n > 0); + int r; - if (n < 0) { - log_error_errno(errno, "Internal pager failed: %m"); + r = copy_bytes(STDIN_FILENO, STDOUT_FILENO, (off_t) -1, false); + if (r < 0) { + log_error_errno(r, "Internal pager failed: %m"); _exit(EXIT_FAILURE); } |