mirror of
https://github.com/scylladb/scylladb.git
synced 2026-04-22 09:30:45 +00:00
posix: fix file_desc::map() error checking
mmap(2) returns MAP_FAILED on error, not nullptr.
This commit is contained in:
@@ -228,7 +228,7 @@ public:
|
||||
|
||||
void *map(size_t size, unsigned flags, bool shared, size_t offset) {
|
||||
void *x = mmap(NULL, size, flags, shared ? MAP_SHARED : MAP_PRIVATE, _fd, offset);
|
||||
throw_system_error_on(x == nullptr);
|
||||
throw_system_error_on(x == MAP_FAILED);
|
||||
return x;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user