Skip to content

Commit

Permalink
libdl.a: make dlerror() always report an error.
Browse files Browse the repository at this point in the history
Seems only logical, given that all the other calls fail.

(Only thing that's weird about this is that calling dlerror() usually
clears the error until you do something else that causes an error, but
that doesn't seem worth the bookkeeping?)

Bug: android/ndk#965
Test: static unit tests still pass
Change-Id: I5e5401e148c5857f1dbab9c5a7f4a6fc43d8d626
  • Loading branch information
enh-google committed Apr 22, 2019
1 parent 493322b commit 915c5fb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libdl/libdl_static.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ void* dlopen(const char* /*filename*/, int /*flag*/) {
}

char* dlerror() {
return nullptr;
return const_cast<char*>("libdl.a is a stub --- use libdl.so instead");
}

void* dlsym(void* /*handle*/, const char* /*symbol*/) {
Expand Down

0 comments on commit 915c5fb

Please sign in to comment.