Skip to content

Commit d4c8136

Browse files
peffgitster
authored andcommitted
transport-helper: drop read/write errno checks
Since we use xread() and xwrite() here, EINTR, EAGAIN, and EWOULDBLOCK retries are already handled for us, and we will never see these errno values ourselves. We can drop these conditions entirely, making the code easier to follow. Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent c14e5a1 commit d4c8136

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

transport-helper.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1226,8 +1226,7 @@ static int udt_do_read(struct unidirectional_transfer *t)
12261226

12271227
transfer_debug("%s is readable", t->src_name);
12281228
bytes = xread(t->src, t->buf + t->bufuse, BUFFERSIZE - t->bufuse);
1229-
if (bytes < 0 && errno != EWOULDBLOCK && errno != EAGAIN &&
1230-
errno != EINTR) {
1229+
if (bytes < 0) {
12311230
error_errno(_("read(%s) failed"), t->src_name);
12321231
return -1;
12331232
} else if (bytes == 0) {
@@ -1254,7 +1253,7 @@ static int udt_do_write(struct unidirectional_transfer *t)
12541253

12551254
transfer_debug("%s is writable", t->dest_name);
12561255
bytes = xwrite(t->dest, t->buf, t->bufuse);
1257-
if (bytes < 0 && errno != EWOULDBLOCK) {
1256+
if (bytes < 0) {
12581257
error_errno(_("write(%s) failed"), t->dest_name);
12591258
return -1;
12601259
} else if (bytes > 0) {

0 commit comments

Comments
 (0)