1
0
mirror of https://github.com/golang/go synced 2024-11-18 14:04:45 -07:00

plugin: cast dlerror return value for android

Until a few weeks ago, bionic, the Andoid libc, incorrectly
returned const char* (instead of char*) from dlerror(3).

5e071a18ce

Change-Id: I30d33240c63a9f35b6c20ca7e3928ad33bc5e33f
Reviewed-on: https://go-review.googlesource.com/29352
Run-TryBot: David Crawshaw <crawshaw@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
David Crawshaw 2016-09-16 15:08:17 -04:00
parent 2e2db7a170
commit 5c0fbf052b

View File

@ -16,7 +16,7 @@ package plugin
static uintptr_t pluginOpen(const char* path, char** err) {
void* h = dlopen(path, RTLD_NOW|RTLD_GLOBAL);
if (h == NULL) {
*err = dlerror();
*err = (char*)dlerror();
}
return (uintptr_t)h;
}
@ -24,7 +24,7 @@ static uintptr_t pluginOpen(const char* path, char** err) {
static void* pluginLookup(uintptr_t h, const char* name, char** err) {
void* r = dlsym((void*)h, name);
if (r == NULL) {
*err = dlerror();
*err = (char*)dlerror();
}
return r;
}