From 70c1372b5a85a64d5ea7c5bb20b99429213942be Mon Sep 17 00:00:00 2001 From: Mateusz Moscicki Date: Mon, 28 May 2018 12:46:32 +0200 Subject: [PATCH] crash-pipe: Fix write the coredump to the file splice len parameter is size_t type. On some architectures (eg. aarch64) splice returned EINVAL when the parameter len was ssize_t variable and was equal SSIZE_MAX Change-Id: Id84038662dcd2969a33af1e276a3b4500a780f29 --- src/crash-pipe/crash-pipe.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/crash-pipe/crash-pipe.c b/src/crash-pipe/crash-pipe.c index d04037b..0a8cb4d 100644 --- a/src/crash-pipe/crash-pipe.c +++ b/src/crash-pipe/crash-pipe.c @@ -32,6 +32,7 @@ #include #include #include +#include enum { OPT_HELP, @@ -74,7 +75,7 @@ static int copy_fd_splice(int in, int out) ssize_t s; _Bool copied_data = 0; - const ssize_t max_splice = SSIZE_MAX; + const size_t max_splice = SIZE_MAX; do { s = splice(in, NULL, out, NULL, max_splice, SPLICE_F_MOVE); -- 2.7.4