Commit 5c0fbf05 authored by David Crawshaw's avatar David Crawshaw

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).

https://android.googlesource.com/platform/bionic/+/5e071a18ce88d93fcffaebb9e0f62524ae504908

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: default avatarIan Lance Taylor <iant@golang.org>
parent 2e2db7a1
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment