mirror of https://github.com/mgba-emu/mgba.git
Util: Failed file mapping should return NULL on POSIX
This commit is contained in:
parent
7752c0c849
commit
c22aaadf7f
1
CHANGES
1
CHANGES
|
@ -9,6 +9,7 @@ Other fixes:
|
|||
- FFmpeg: Fix crash when encoding audio with some containers
|
||||
- FFmpeg: Fix GIF recording (fixes mgba.io/i/2393)
|
||||
- GB, GBA: Save writeback-pending masked saves on unload (fixes mgba.io/i/2396)
|
||||
- VFS: Failed file mapping should return NULL on POSIX
|
||||
Misc:
|
||||
- Qt: Enable -b for Boot BIOS menu option (fixes mgba.io/i/2074)
|
||||
|
||||
|
|
|
@ -132,7 +132,11 @@ static void* _vfdMap(struct VFile* vf, size_t size, int flags) {
|
|||
if (flags & MAP_WRITE) {
|
||||
mmapFlags = MAP_SHARED;
|
||||
}
|
||||
return mmap(0, size, PROT_READ | PROT_WRITE, mmapFlags, vfd->fd, 0);
|
||||
void* mapped = mmap(0, size, PROT_READ | PROT_WRITE, mmapFlags, vfd->fd, 0);
|
||||
if (mapped == MAP_FAILED) {
|
||||
return NULL;
|
||||
}
|
||||
return mapped;
|
||||
}
|
||||
|
||||
static void _vfdUnmap(struct VFile* vf, void* memory, size_t size) {
|
||||
|
|
Loading…
Reference in New Issue