X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=engines%2Fsplice.c;h=b92da4a85577d1d945b354699861ff412ef6b1d7;hp=59bf7e4f8ed19660d694a4ebf3de0718d27fe583;hb=fdefd987d7ba284c7a9e101911c4b8e72fe326ad;hpb=da751ca9665bcdeca56d2eec5b629a0953c07662 diff --git a/engines/splice.c b/engines/splice.c index 59bf7e4f..b92da4a8 100644 --- a/engines/splice.c +++ b/engines/splice.c @@ -13,7 +13,6 @@ #include #include "../fio.h" -#include "../os.h" #ifdef FIO_HAVE_SPLICE @@ -48,7 +47,7 @@ static int fio_splice_read(struct thread_data *td, struct io_u *io_u) if (errno == ENODATA || errno == EAGAIN) continue; - return errno; + return -errno; } buflen -= ret; @@ -56,7 +55,7 @@ static int fio_splice_read(struct thread_data *td, struct io_u *io_u) while (ret) { ret2 = read(sd->pipe[0], p, ret); if (ret2 < 0) - return errno; + return -errno; ret -= ret2; p += ret2; @@ -90,7 +89,7 @@ static int fio_splice_write(struct thread_data *td, struct io_u *io_u) ret = vmsplice(sd->pipe[1], iov, 1, SPLICE_F_NONBLOCK); if (ret < 0) - return errno; + return -errno; iov[0].iov_len -= ret; iov[0].iov_base += ret; @@ -98,7 +97,7 @@ static int fio_splice_write(struct thread_data *td, struct io_u *io_u) while (ret) { ret2 = splice(sd->pipe[0], NULL, f->fd, &off, ret, 0); if (ret2 < 0) - return errno; + return -errno; ret -= ret2; }