mirror of
https://github.com/fumiama/simple-kanban.git
synced 2026-06-26 22:20:28 +08:00
fix: mis-closed file before init
This commit is contained in:
1
file.h
1
file.h
@@ -143,6 +143,7 @@ int file_cache_realloc(file_cache_t* fc, uint64_t newsize) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int file_cache_close(file_cache_t* fc) {
|
int file_cache_close(file_cache_t* fc) {
|
||||||
|
if(!fc->data) return 0;
|
||||||
if(munmap(fc->data - sizeof(uint64_t), fc->size) < 0) {
|
if(munmap(fc->data - sizeof(uint64_t), fc->size) < 0) {
|
||||||
perror("munmap");
|
perror("munmap");
|
||||||
return -1;
|
return -1;
|
||||||
|
|||||||
Reference in New Issue
Block a user