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

  1. #include <buffer.h>
  2. #include <stdlib.h>
  3. #include <unistd.h>
  4. #ifdef __MINGW32__
  5. #include <windows.h>
  6. #else
  7. #include <sys/mman.h>
  8. #endif
  9. void buffer_close(buffer* b) {
  10. if (b->fd != -1) close(b->fd);
  11. switch (b->todo) {
  12. case FREE: free(b->x); break;
  13. case MUNMAP:
  14. #ifdef __MINGW32__
  15. UnmapViewOfFile(b->x);
  16. #else
  17. munmap(b->x,b->a); break;
  18. #endif
  19. default: ;
  20. }
  21. }