Print dlerror() for debugging 93/171293/1
authorsurya.kumar7 <surya.kumar7@samsung.com>
Wed, 28 Feb 2018 07:30:23 +0000 (13:00 +0530)
committersurya.kumar7 <surya.kumar7@samsung.com>
Wed, 28 Feb 2018 08:59:42 +0000 (14:29 +0530)
dlopen() fails for numerous reasons and returns NULL in such cases.
Logging the error will be useful for inspecting the failure reason.

Change-Id: Idc21de1165537160baf1c7dfbb76a2b3c3cfe2d8
Signed-off-by: surya.kumar7 <surya.kumar7@samsung.com>
loader/wrt_loader.cc

index 14ea066..d42d69d 100644 (file)
@@ -21,7 +21,7 @@
 int main(int argc, char* argv[]) {
   void* handle = dlopen("/usr/bin/xwalk_runtime", RTLD_NOW);
   if (!handle) {
-    dlog_print(DLOG_DEBUG, "XWALK", "Error loading xwalk_runtime");
+    dlog_print(DLOG_ERROR, "XWALK", "Error loading xwalk_runtime: %s", dlerror());
     return false;
   }
 
@@ -29,7 +29,7 @@ int main(int argc, char* argv[]) {
 
   MAIN_FUNC real_main = reinterpret_cast<MAIN_FUNC>(dlsym(handle, "main"));
   if (!real_main) {
-    dlog_print(DLOG_DEBUG, "XWALK", "Error loading real_main");
+    dlog_print(DLOG_ERROR, "XWALK", "Error loading real_main: %s", dlerror());
     return false;
   }