Return -1 for ASharedMemory_create if the function is not available.
PiperOrigin-RevId: 231504648
This commit is contained in:
parent
8148037cde
commit
26b9784074
@ -59,7 +59,8 @@ inline int ASharedMemory_create(const char* name, size_t size) {
|
|||||||
handle != nullptr ? reinterpret_cast<ASharedMemory_create_fn>(
|
handle != nullptr ? reinterpret_cast<ASharedMemory_create_fn>(
|
||||||
dlsym(handle, "ASharedMemory_create"))
|
dlsym(handle, "ASharedMemory_create"))
|
||||||
: nullptr;
|
: nullptr;
|
||||||
return fn(name, size);
|
int fd = fn != nullptr ? fn(name, size) : -1;
|
||||||
|
return fd;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void* getLibraryHandle() {
|
inline void* getLibraryHandle() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user