]> git.ipfire.org Git - thirdparty/git.git/commitdiff
transport-helper: use xread instead of read
authorRandall S. Becker <randall.becker@nexbridge.ca>
Thu, 3 Jan 2019 21:03:48 +0000 (16:03 -0500)
committerJunio C Hamano <gitster@pobox.com>
Thu, 3 Jan 2019 21:58:25 +0000 (13:58 -0800)
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>
transport-helper.c

index bf225c698fac81a9a94eff6d3371988ac4ff0bac..a290695a120e05f7f653828af6d94bafdbc79e9b 100644 (file)
@@ -1225,7 +1225,7 @@ static int udt_do_read(struct unidirectional_transfer *t)
                return 0;       /* No space for more. */
 
        transfer_debug("%s is readable", t->src_name);
-       bytes = read(t->src, t->buf + t->bufuse, BUFFERSIZE - t->bufuse);
+       bytes = xread(t->src, t->buf + t->bufuse, BUFFERSIZE - t->bufuse);
        if (bytes < 0 && errno != EWOULDBLOCK && errno != EAGAIN &&
                errno != EINTR) {
                error_errno(_("read(%s) failed"), t->src_name);