]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Revert "sideband: use writev(3p) to send pktlines"
authorJunio C Hamano <gitster@pobox.com>
Thu, 9 Apr 2026 21:47:51 +0000 (14:47 -0700)
committerJunio C Hamano <gitster@pobox.com>
Thu, 9 Apr 2026 21:47:51 +0000 (14:47 -0700)
This reverts commit 26986f4cbaf38d84a82b0b35da211389ce49552c; let's
not use writev() for now.

sideband.c

index 1ed6614eaf1baf8747ef613933433060cc1a8be4..ea7c25211ef7e1c8a80cb60475ee43457c8c13f1 100644 (file)
@@ -264,7 +264,6 @@ void send_sideband(int fd, int band, const char *data, ssize_t sz, int packet_ma
        const char *p = data;
 
        while (sz) {
-               struct iovec iov[2];
                unsigned n;
                char hdr[5];
 
@@ -274,19 +273,12 @@ void send_sideband(int fd, int band, const char *data, ssize_t sz, int packet_ma
                if (0 <= band) {
                        xsnprintf(hdr, sizeof(hdr), "%04x", n + 5);
                        hdr[4] = band;
-                       iov[0].iov_base = hdr;
-                       iov[0].iov_len = 5;
+                       write_or_die(fd, hdr, 5);
                } else {
                        xsnprintf(hdr, sizeof(hdr), "%04x", n + 4);
-                       iov[0].iov_base = hdr;
-                       iov[0].iov_len = 4;
+                       write_or_die(fd, hdr, 4);
                }
-
-               iov[1].iov_base = (void *) p;
-               iov[1].iov_len = n;
-
-               writev_or_die(fd, iov, ARRAY_SIZE(iov));
-
+               write_or_die(fd, p, n);
                p += n;
                sz -= n;
        }