]> Cypherpunks repositories - gostls13.git/commitdiff
plugin: cast dlerror return value for android
authorDavid Crawshaw <crawshaw@golang.org>
Fri, 16 Sep 2016 19:08:17 +0000 (15:08 -0400)
committerDavid Crawshaw <crawshaw@golang.org>
Sat, 17 Sep 2016 13:47:37 +0000 (13:47 +0000)
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: Ian Lance Taylor <iant@golang.org>
src/plugin/plugin_dlopen.go

index 5a9421efcf5cce2341ea56d9c43f6d583d493951..45c0eeb07fd141d2958e0ad65034df5b6c72a307 100644 (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;
 }