From e2d8e94aa1c8bda34fcc2c73afd5b15d90667ecf Mon Sep 17 00:00:00 2001 From: Andrzej Popowski Date: Fri, 16 Oct 2015 13:31:55 +0200 Subject: [PATCH] [Tool] fixed checking of dlopen failure into tizen_2.4 Change-Id: I8d76b51da9a11e60f3a2375530c5877b68e32596 Signed-off-by: Andrzej Popowski --- src/tool/desc_gentool.cc | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) 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; } -- 2.34.1