Skip to content
Snippets Groups Projects
Commit f6c078e2 authored by Chris Wolf's avatar Chris Wolf
Browse files

Make sure dlopen clears last error upon successful load.

git-svn-id: http://svn.xiph.org/trunk/ao@1990 0101bb08-14d6-0310-b084-bc0e0c8e3800
parent 684f7e16
No related branches found
No related tags found
No related merge requests found
/*
* $Id: dlfcn.c,v 1.1 2001/09/05 19:10:01 cwolf Exp $
* $Id: dlfcn.c,v 1.2 2001/09/07 21:10:55 cwolf Exp $
* $Name: $
*
* Adopted from Apache DSO code.
......@@ -39,10 +39,13 @@ void *dlopen(const char *module_name, int mode)
*/
em = SetErrorMode(SEM_FAILCRITICALERRORS);
dsoh = LoadLibraryEx(path, NULL, LOAD_WITH_ALTERED_SEARCH_PATH);
if (!dsoh) {
if (!dsoh)
{
SetLastError(0); // clear the last error
dsoh = LoadLibraryEx(path, NULL, 0);
}
SetErrorMode(em);
SetLastError(0); // clear the last error
return (void *)dsoh;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment