You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by yd...@apache.org on 2014/02/22 16:17:20 UTC

svn commit: r1570848 - /openoffice/trunk/main/sal/osl/os2/module.c

Author: ydario
Date: Sat Feb 22 15:17:20 2014
New Revision: 1570848

URL: http://svn.apache.org/r1570848
Log:
#i118923# OS/2 port, ignore ENOENT errors on dlopen() failure.

Modified:
    openoffice/trunk/main/sal/osl/os2/module.c

Modified: openoffice/trunk/main/sal/osl/os2/module.c
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sal/osl/os2/module.c?rev=1570848&r1=1570847&r2=1570848&view=diff
==============================================================================
--- openoffice/trunk/main/sal/osl/os2/module.c (original)
+++ openoffice/trunk/main/sal/osl/os2/module.c Sat Feb 22 15:17:20 2014
@@ -73,7 +73,6 @@ oslModule SAL_CALL osl_loadAsciiModule(c
 	char buffer[PATH_MAX];
 	char* dot;
 	void* hModule;
-	oslModule pModule = NULL;
 
 	if (!pszModuleName)
 		return NULL;
@@ -99,28 +98,35 @@ oslModule SAL_CALL osl_loadAsciiModule(c
 #if OSL_DEBUG_LEVEL>1
 	debug_printf("osl_loadModule module %s", buffer);
 #endif
-	
+
 	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;
 }
 
 /*****************************************************************************/