libowfat/io/iob_addbuf_free.c
leitner c2a2a15c12 document the return value expected from the callback given to iob_write
remove unused #include in iob_reset
if iob_addfile_close fails, it now closes the fd
if iob_addbuf_munmap fails, it now munmaps the buf
if iob_addbuf_free fails, it now frees the buf
some win32 cross-compile fixes for iarray
2012-02-24 02:00:52 +00:00

14 lines
270 B
C

#include <stdlib.h>
#include "iob_internal.h"
static void cleanup(struct iob_entry* x) {
free((char*)x->buf);
}
int iob_addbuf_free(io_batch* b,const void* buf,uint64 n) {
int r=iob_addbuf_internal(b,buf,n,cleanup);
if (r==0)
free((char*)buf);
return r;
}