From: Andrzej Popowski Date: Fri, 16 Oct 2015 11:31:55 +0000 (+0200) Subject: [Tool] fixed checking of dlopen failure into tizen_2.4 X-Git-Tag: submit/tizen/20151026.073646^2^2~14^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e2d8e94aa1c8bda34fcc2c73afd5b15d90667ecf;p=platform%2Fcore%2Fapi%2Fwebapi-plugins.git [Tool] fixed checking of dlopen failure into tizen_2.4 Change-Id: I8d76b51da9a11e60f3a2375530c5877b68e32596 Signed-off-by: Andrzej Popowski --- diff --git a/src/tool/desc_gentool.cc b/src/tool/desc_gentool.cc index 69fc6ceb..e0570ef9 100644 --- a/src/tool/desc_gentool.cc +++ b/src/tool/desc_gentool.cc @@ -170,11 +170,11 @@ int main(int argc, char* argv[]) { !fname.compare(fname.size() - postfix_.size(), postfix_.size(), postfix_)) { std::string so_path = tce_path + "/" + fname; - char* error; void *handle = dlopen(so_path.c_str(), RTLD_LAZY); - if ((error = dlerror()) != NULL) { + if (handle == NULL) { std::cerr << "cannot open " << so_path << std::endl; - std::cerr << "Error >>" << error << std::endl; + char* error = dlerror(); + std::cerr << "Error >>" << ((error == NULL) ? "NULL" : error) << std::endl; return -1; } @@ -212,6 +212,4 @@ int main(int argc, char* argv[]) { // it would be need for ignore loaded libraries destructor _exit(0); - - return 0; }