summaryrefslogtreecommitdiff
path: root/src/shared
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-08-28 00:11:49 +0200
committerLennart Poettering <lennart@poettering.net>2015-08-28 02:05:51 +0200
commit6a7c676c54eb205d80f124eeb66c84df3c54d174 (patch)
tree8aa09bcccabccad4f3eda0509a12b7593d75c5a5 /src/shared
parent81d20007f966e36cc8c9161b7117f3f1affdba02 (diff)
downloadsystemd-6a7c676c54eb205d80f124eeb66c84df3c54d174.tar.gz
systemd-6a7c676c54eb205d80f124eeb66c84df3c54d174.tar.bz2
systemd-6a7c676c54eb205d80f124eeb66c84df3c54d174.zip
pager: port fallback pager to use copy_bytes()
Diffstat (limited to 'src/shared')
-rw-r--r--src/shared/pager.c12
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);
}