Revert "sideband: use writev(3p) to send pktlines"
This reverts commit 26986f4cbaf38d84a82b0b35da211389ce49552c; let's not use writev() for now.
Junio C Hamano committed
Apr 9, 2026 at 14:47 UTC
74fbd8a571abe7b15de01956ba4599e500c31ac0
1 file changed
+3
-11
sideband.c
+3
-11
@@ -264,7 +264,6 @@ void send_sideband(int fd, int band, const char *data, ssize_t sz, int packet_ma
264
const char *p = data;
265
266
while (sz) {
267
- struct iovec iov[2];
267
unsigned n;
268
char hdr[5];
269
@@ -274,19 +273,12 @@ void send_sideband(int fd, int band, const char *data, ssize_t sz, int packet_ma
273
if (0 <= band) {
274
xsnprintf(hdr, sizeof(hdr), "%04x", n + 5);
275
hdr[4] = band;
277
- iov[0].iov_base = hdr;
278
- iov[0].iov_len = 5;
276
+ write_or_die(fd, hdr, 5);
277
} else {
278
xsnprintf(hdr, sizeof(hdr), "%04x", n + 4);
281
- iov[0].iov_base = hdr;
282
- iov[0].iov_len = 4;
279
+ write_or_die(fd, hdr, 4);
280
}
284
-
285
- iov[1].iov_base = (void *) p;
286
- iov[1].iov_len = n;
287
-
288
- writev_or_die(fd, iov, ARRAY_SIZE(iov));
289
-
281
+ write_or_die(fd, p, n);
282
p += n;
283
sz -= n;
284
}