Merge "dlerror returns char*, not const char*."
This commit is contained in:
commit
166f875eab
3 changed files with 6 additions and 6 deletions
|
@ -51,7 +51,7 @@ typedef struct {
|
|||
|
||||
void* dlopen(const char* filename, int flag);
|
||||
int dlclose(void* _Nonnull handle);
|
||||
const char* dlerror(void);
|
||||
char* dlerror(void);
|
||||
void* dlsym(void* handle, const char* _Nonnull symbol);
|
||||
void* dlvsym(void* handle, const char* _Nonnull symbol, const char* _Nonnull version) __INTRODUCED_IN(24);
|
||||
int dladdr(const void* addr, Dl_info* _Nonnull info);
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
|
||||
void* dlopen(const char* filename __unused, int flag __unused) { return 0; }
|
||||
|
||||
const char* dlerror(void) { return 0; }
|
||||
char* dlerror(void) { return 0; }
|
||||
|
||||
void* dlsym(void* handle __unused, const char* symbol __unused) { return 0; }
|
||||
|
||||
|
|
|
@ -33,10 +33,10 @@
|
|||
|
||||
static pthread_mutex_t g_dl_mutex = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
|
||||
|
||||
static const char* __bionic_set_dlerror(char* new_value) {
|
||||
static char* __bionic_set_dlerror(char* new_value) {
|
||||
char** dlerror_slot = &reinterpret_cast<char**>(__get_tls())[TLS_SLOT_DLERROR];
|
||||
|
||||
const char* old_value = *dlerror_slot;
|
||||
char* old_value = *dlerror_slot;
|
||||
*dlerror_slot = new_value;
|
||||
return old_value;
|
||||
}
|
||||
|
@ -52,8 +52,8 @@ static void __bionic_format_dlerror(const char* msg, const char* detail) {
|
|||
__bionic_set_dlerror(buffer);
|
||||
}
|
||||
|
||||
const char* dlerror() {
|
||||
const char* old_value = __bionic_set_dlerror(nullptr);
|
||||
char* dlerror() {
|
||||
char* old_value = __bionic_set_dlerror(nullptr);
|
||||
return old_value;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue