only use writev for larger chunks in buffer_putflush

only use lseek if it saves a read in buffer_seek
This commit is contained in:
leitner
2020-11-10 21:51:22 +00:00
parent 45f7a362e0
commit b67a1af443
2 changed files with 3 additions and 2 deletions

View File

@@ -22,7 +22,7 @@ int buffer_putflush(buffer* b,const char* x,size_t len) {
if (!b->p) /* if the buffer is empty, just call buffer_stubborn directly */
return buffer_stubborn(b->op,b->fd,x,len,b);
#ifndef __MINGW32__
if (b->op==write) {
if (b->op==write && len>sizeof(struct iovec)*2) {
struct iovec v[2];
ssize_t w;
size_t cl=b->p+len;