[xiph-cvs] cvs commit: ao/win32/src dlfcn.c

Chris Wolf cwolf at xiph.org
Fri Sep 7 14:10:55 PDT 2001



cwolf       01/09/07 14:10:55

  Modified:    win32/src dlfcn.c
  Log:
  Make sure dlopen clears last error upon successful load.

Revision  Changes    Path
1.2       +6 -3      ao/win32/src/dlfcn.c

Index: dlfcn.c
===================================================================
RCS file: /usr/local/cvsroot/ao/win32/src/dlfcn.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- dlfcn.c	2001/09/05 19:10:01	1.1
+++ dlfcn.c	2001/09/07 21:10:55	1.2
@@ -1,5 +1,5 @@
 /*
- * $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 @@
      */
     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;
 }
 

--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'cvs-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the commits mailing list