libowfat/buffer/buffer_stubborn.c
leitner 5eb1cdf888 cleanups in stralloc and buffer:
int -> long for sizes
    char -> unsigned char for strings
2004-11-25 21:29:35 +00:00

16 lines
289 B
C

#include <errno.h>
#include "buffer.h"
int buffer_stubborn(int (*op)(),int fd,const unsigned char* buf, unsigned long int len) {
int w;
while (len) {
if ((w=op(fd,buf,len))<0) {
if (errno == EINTR) continue;
return -1;
};
buf+=w;
len-=w;
}
return 0;
}