Updated libs
This commit is contained in:
parent
e1e1cfc821
commit
0e305e4334
@ -44,25 +44,8 @@ struct OpenFile load_file_to_mem(char *filename) {
|
||||
printf("Unmapping failed");
|
||||
exit(1);
|
||||
}
|
||||
close(fd);
|
||||
|
||||
return file;
|
||||
}
|
||||
|
||||
int unmap_file(char *ptr, char *filename) {
|
||||
int fd = open(filename, O_RDONLY);
|
||||
|
||||
if (fd < 0) {
|
||||
printf("\n\"%s \" could not open", filename);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
struct stat statbuf;
|
||||
int err = fstat(fd, &statbuf);
|
||||
err = munmap(ptr, statbuf.st_size);
|
||||
if (err != 0)
|
||||
{
|
||||
printf("Unmapping failed");
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user