diff --git a/lib/libzfs_core/libzfs_core.c b/lib/libzfs_core/libzfs_core.c index c63a16de5a..01d803e21d 100644 --- a/lib/libzfs_core/libzfs_core.c +++ b/lib/libzfs_core/libzfs_core.c @@ -650,10 +650,12 @@ send_worker(void *arg) unsigned int bufsiz = max_pipe_buffer(ctx->from); ssize_t rd; - while ((rd = splice(ctx->from, NULL, ctx->to, NULL, bufsiz, - SPLICE_F_MOVE | SPLICE_F_MORE)) > 0) - ; - + for (;;) { + rd = splice(ctx->from, NULL, ctx->to, NULL, bufsiz, + SPLICE_F_MOVE | SPLICE_F_MORE); + if ((rd == -1 && errno != EINTR) || rd == 0) + break; + } int err = (rd == -1) ? errno : 0; close(ctx->from); return ((void *)(uintptr_t)err);