From 523f6f4765987ba70862279366fc0540ff514a39 Mon Sep 17 00:00:00 2001 From: leitner Date: Wed, 21 Jul 2004 16:00:47 +0000 Subject: [PATCH] cosmetics: use write instead of writev if there is only one buffer to write (looks nicer in strace) --- io/iob_send.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/io/iob_send.c b/io/iob_send.c index 855ca20..445a79f 100644 --- a/io/iob_send.c +++ b/io/iob_send.c @@ -10,6 +10,7 @@ #include #include #include +#include #include "havealloca.h" #include "iob_internal.h" @@ -65,7 +66,10 @@ int64 iob_send(int64 s,io_batch* b) { } else sent=-3; } else { - sent=writev(s,v,headers); + if (headers==1) /* cosmetics for strace */ + sent=write(s,v[0].iov_base,v[0].iov_len); + else + sent=writev(s,v,headers); if (sent==-1) { if (errno!=EAGAIN) sent=-3; @@ -84,7 +88,10 @@ eagain: } #endif if (headers) { - sent=writev(s,v,headers); + if (headers==1) /* cosmetics for strace */ + sent=write(s,v[0].iov_base,v[0].iov_len); + else + sent=writev(s,v,headers); if (sent==-1) { if (errno==EAGAIN) { io_eagain(s);