mirror of https://github.com/mgba-emu/mgba.git
Util: Failed file mapping should return NULL on POSIX
This commit is contained in:
parent
cea11fadc4
commit
4312ce14ff
1
CHANGES
1
CHANGES
|
@ -39,6 +39,7 @@ Other fixes:
|
||||||
- FFmpeg: Fix GIF recording (fixes mgba.io/i/2393)
|
- FFmpeg: Fix GIF recording (fixes mgba.io/i/2393)
|
||||||
- GB: Fix temporary saves
|
- GB: Fix temporary saves
|
||||||
- GB, GBA: Save writeback-pending masked saves on unload (fixes mgba.io/i/2396)
|
- GB, GBA: Save writeback-pending masked saves on unload (fixes mgba.io/i/2396)
|
||||||
|
- VFS: Failed file mapping should return NULL on POSIX
|
||||||
Misc:
|
Misc:
|
||||||
- Core: Suspend runloop when a core crashes
|
- Core: Suspend runloop when a core crashes
|
||||||
- GB Video: Add default SGB border
|
- GB Video: Add default SGB border
|
||||||
|
|
|
@ -132,7 +132,11 @@ static void* _vfdMap(struct VFile* vf, size_t size, int flags) {
|
||||||
if (flags & MAP_WRITE) {
|
if (flags & MAP_WRITE) {
|
||||||
mmapFlags = MAP_SHARED;
|
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) {
|
static void _vfdUnmap(struct VFile* vf, void* memory, size_t size) {
|
||||||
|
|
Loading…
Reference in New Issue