From: David Crawshaw Date: Fri, 16 Sep 2016 19:08:17 +0000 (-0400) Subject: plugin: cast dlerror return value for android X-Git-Tag: go1.8beta1~1251 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=5c0fbf052b8ab98c0a1dd74365912d33572be4f3;p=gostls13.git 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 TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor --- diff --git a/src/plugin/plugin_dlopen.go b/src/plugin/plugin_dlopen.go index 5a9421efcf..45c0eeb07f 100644 --- a/src/plugin/plugin_dlopen.go +++ b/src/plugin/plugin_dlopen.go @@ -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; }