transport-helper: use xread instead of read
This fix was needed on HPE NonStop NSE and NSX where SSIZE_MAX is less than BUFFERSIZE resulting in EINVAL. The call to read in transport-helper.c was the only place outside of wrapper.c where it is used instead of xread. Signed-off-by: Randall S. Becker <rsbecker@nexbridge.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Randall S. Becker committed
Jan 3, 2019 at 16:03 UTC
c14e5a1a5018f4407390488dfea387e5dc81c817
1 file changed
+1
-1
transport-helper.c
+1
-1
@@ -1225,7 +1225,7 @@ static int udt_do_read(struct unidirectional_transfer *t)
1225
return 0; /* No space for more. */
1226
1227
transfer_debug("%s is readable", t->src_name);
1228
- bytes = read(t->src, t->buf + t->bufuse, BUFFERSIZE - t->bufuse);
1228
+ bytes = xread(t->src, t->buf + t->bufuse, BUFFERSIZE - t->bufuse);
1229
if (bytes < 0 && errno != EWOULDBLOCK && errno != EAGAIN &&
1230
errno != EINTR) {
1231
error_errno(_("read(%s) failed"), t->src_name);