Skip to content

Commit

Permalink
Fix occasional rsend test crashes
Browse files Browse the repository at this point in the history
Signed-off-by: Paul Dagnelie <[email protected]>
  • Loading branch information
pcd1193182 committed Sep 13, 2023
1 parent 8af8d2a commit 12ce094
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lib/libzfs_core/libzfs_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 * EINTR && rd < 0)
break;
}
int err = (rd == -1) ? errno : 0;
close(ctx->from);
return ((void *)(uintptr_t)err);
Expand Down

0 comments on commit 12ce094

Please sign in to comment.