diff options
author | Yuri Dario <ydario@apache.org> | 2014-02-22 15:17:20 +0000 |
---|---|---|
committer | Yuri Dario <ydario@apache.org> | 2014-02-22 15:17:20 +0000 |
commit | 48eb121f9925583304f59cee2a1f217257f970d5 (patch) | |
tree | 0c7e599f34bccced82de1a427e380a26ddf655ed /sal/osl | |
parent | 28f97ab153a3226a5206a53937849bcc287682da (diff) |
#i118923# OS/2 port, ignore ENOENT errors on dlopen() failure.
Notes
Notes:
ignore: OS/2
Diffstat (limited to 'sal/osl')
-rw-r--r-- | sal/osl/os2/module.c | 34 |
1 files changed, 20 insertions, 14 deletions
diff --git a/sal/osl/os2/module.c b/sal/osl/os2/module.c index efd6719b3772..ee6dd26d3107 100644 --- a/sal/osl/os2/module.c +++ b/sal/osl/os2/module.c @@ -73,7 +73,6 @@ oslModule SAL_CALL osl_loadAsciiModule(const sal_Char *pszModuleName, sal_Int32 char buffer[PATH_MAX]; char* dot; void* hModule; - oslModule pModule = NULL; if (!pszModuleName) return NULL; @@ -102,25 +101,32 @@ oslModule SAL_CALL osl_loadAsciiModule(const sal_Char *pszModuleName, sal_Int32 hModule = dlopen( buffer, RTLD_LOCAL); if (hModule != NULL) - pModule = (oslModule)hModule; - else - { - sal_Char szError[ PATH_MAX*2 ]; - sprintf( szError, "Module: %s;\n error: %s;\n\n" - "Please contact technical support and report above informations.\n\n", - buffer, dlerror() ); + return (oslModule)hModule; + + // do not show in case rc=2 ENOENT, we must parse dlerror + // string to detect it + char* err = dlerror(); + if (!err) + return NULL; + + if (strstr( err, "rc=2") != NULL) + return NULL; + + sal_Char szError[ PATH_MAX*2 ]; + sprintf( szError, "Module: %s;\n error: %s;\n\n" + "Please contact technical support and report above informations.\n\n", + buffer, err); #if OSL_DEBUG_LEVEL>0 - debug_printf("osl_loadModule error %s", szError); + debug_printf("osl_loadModule error %s", szError); #endif #if (OSL_DEBUG_LEVEL==0) || !defined(OSL_DEBUG_LEVEL) - WinMessageBox(HWND_DESKTOP,HWND_DESKTOP, - szError, "Critical error: DosLoadModule failed", - 0, MB_ERROR | MB_OK | MB_MOVEABLE); + WinMessageBox(HWND_DESKTOP,HWND_DESKTOP, + szError, "Critical error: DosLoadModule failed", + 0, MB_ERROR | MB_OK | MB_MOVEABLE); #endif - } - return pModule; + return NULL; } /*****************************************************************************/ |