Mirror of :pserver:cvs@cvs.fefe.de:/cvs libowfat https://www.fefe.de/libowfat/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

22 lines
376 B

#include <buffer.h>
#include <stdlib.h>
#include <unistd.h>
#ifdef __MINGW32__
#include <windows.h>
#else
#include <sys/mman.h>
#endif
void buffer_close(buffer* b) {
if (b->fd != -1) close(b->fd);
switch (b->todo) {
case FREE: free(b->x); break;
case MUNMAP:
#ifdef __MINGW32__
UnmapViewOfFile(b->x);
#else
munmap(b->x,b->a); break;
#endif
default: ;
}
}