You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14 lines
260 B
C
14 lines
260 B
C
20 years ago
|
#include <buffer.h>
|
||
|
#include <stdlib.h>
|
||
|
#include <unistd.h>
|
||
|
#include <sys/mman.h>
|
||
|
|
||
|
void buffer_close(buffer* b) {
|
||
|
if (b->fd != -1) close(b->fd);
|
||
|
switch (b->todo) {
|
||
|
case FREE: free(b->x); break;
|
||
|
case MUNMAP: munmap(b->x,b->a); break;
|
||
|
default: ;
|
||
|
}
|
||
|
}
|