Return -1 for ASharedMemory_create if the function is not available.

PiperOrigin-RevId: 231504648
This commit is contained in:
A. Unique TensorFlower 2019-01-29 17:18:02 -08:00 committed by TensorFlower Gardener
parent 8148037cde
commit 26b9784074

View File

@ -59,7 +59,8 @@ inline int ASharedMemory_create(const char* name, size_t size) {
handle != nullptr ? reinterpret_cast<ASharedMemory_create_fn>(
dlsym(handle, "ASharedMemory_create"))
: nullptr;
return fn(name, size);
int fd = fn != nullptr ? fn(name, size) : -1;
return fd;
}
inline void* getLibraryHandle() {