Skip to content

Commit 7aa3686

Browse files
schuellerstefanwez
authored andcommitted
fix program freeze if underlying filesystems do not support splice
1 parent d203123 commit 7aa3686

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/parsley.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5785,7 +5785,7 @@ uint64_t splice_copy(int sfd,
57855785
if (didread <= 0) {
57865786
if (errno == EINVAL || errno == ENOSYS) {
57875787
/* splice is not supported by source */
5788-
break;
5788+
goto exit;
57895789
}
57905790
fprintf(stderr,
57915791
"splice(read): %ld of %lu (%s)\n",
@@ -5805,7 +5805,7 @@ uint64_t splice_copy(int sfd,
58055805
if (didwrite <= 0) {
58065806
if (errno == EINVAL || errno == ENOSYS) {
58075807
/* splice is not supported by dest */
5808-
break;
5808+
goto exit;
58095809
}
58105810
fprintf(stderr,
58115811
"splice(write): %ld of %lu (%s)\n",
@@ -5821,6 +5821,7 @@ uint64_t splice_copy(int sfd,
58215821
APar_ShellProgressBar(tally + bytes_written);
58225822
}
58235823

5824+
exit:
58245825
close(pfd[0]);
58255826
close(pfd[1]);
58265827
return bytes_written;

0 commit comments

Comments
 (0)