Skip to content

Commit 74fbd8a

Browse files
committed
Revert "sideband: use writev(3p) to send pktlines"
This reverts commit 26986f4; let's not use writev() for now.
1 parent 9c30ddd commit 74fbd8a

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

sideband.c

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,6 @@ void send_sideband(int fd, int band, const char *data, ssize_t sz, int packet_ma
264264
const char *p = data;
265265

266266
while (sz) {
267-
struct iovec iov[2];
268267
unsigned n;
269268
char hdr[5];
270269

@@ -274,19 +273,12 @@ void send_sideband(int fd, int band, const char *data, ssize_t sz, int packet_ma
274273
if (0 <= band) {
275274
xsnprintf(hdr, sizeof(hdr), "%04x", n + 5);
276275
hdr[4] = band;
277-
iov[0].iov_base = hdr;
278-
iov[0].iov_len = 5;
276+
write_or_die(fd, hdr, 5);
279277
} else {
280278
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);
283280
}
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);
290282
p += n;
291283
sz -= n;
292284
}

0 commit comments

Comments
 (0)