Index: base/native_library_linux.cc |
diff --git a/base/native_library_linux.cc b/base/native_library_linux.cc |
index 99e32c6229ecd6c71f1ef840662a403586a3e329..f31c799b6459f6e9cc2e405e2b0f538c26e7cc95 100644 |
--- a/base/native_library_linux.cc |
+++ b/base/native_library_linux.cc |
@@ -45,7 +45,9 @@ void UnloadNativeLibrary(NativeLibrary library) { |
// static |
void* GetFunctionPointerFromNativeLibrary(NativeLibrary library, |
const char* name) { |
- return dlsym(library, name); |
+ DCHECK(name != NULL) << "NULL name passed in."; |
+ void* lib = dlsym(library, name); |
+ return lib; |
} |
// static |
@@ -53,4 +55,15 @@ string16 GetNativeLibraryName(const string16& name) { |
return ASCIIToUTF16("lib") + name + ASCIIToUTF16(".so"); |
} |
+string16 GetLibraryErrorMessage() { |
+ const char* last_err_message = dlerror(); |
+ string16 err_message; |
+ |
+ if (last_err_message) { |
+ err_message = ASCIIToUTF16(last_err_message); |
+ } |
+ |
+ return err_message; |
+} |
+ |
} // namespace base |