Skip to content

Commit 5f22eae

Browse files
kdaveadam900710
authored andcommitted
btrfs-progs: send-stream: handle EINTR during buffer reads
Read error are handled but EINTR is a transient and can be handled without returning a hard error. Signed-off-by: David Sterba <dsterba@suse.com>
1 parent 51beb20 commit 5f22eae

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

common/send-stream.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ static int read_buf(struct btrfs_send_stream *sctx, char *buf, size_t len)
7676

7777
rbytes = read(sctx->fd, buf + pos, len - pos);
7878
if (rbytes < 0) {
79+
if (errno == EINTR)
80+
continue;
7981
ret = -errno;
8082
error("read from stream failed: %m");
8183
goto out;

0 commit comments

Comments
 (0)