apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wr...@apache.org
Subject svn commit: r543334 - /apr/apr/branches/1.2.x/locks/win32/proc_mutex.c
Date Fri, 01 Jun 2007 00:13:57 GMT
Author: wrowe
Date: Thu May 31 17:13:57 2007
New Revision: 543334

URL: http://svn.apache.org/viewvc?view=rev&rev=543334
Log:
apr_proc_mutex_child_init calls unimplemented OpenMutexW and will fail to
compile on Windows CE.  The patch implements the expected behavior of
OpenMutexW by calling CreateMutex (which will open an existing mutex or 
create one if it doesn't exist) and close the mutex and return an error 
unless CreateMutex indicated that the mutex already existed.

PR: 39858
Submitted by: Curt Arnold <carnold apache.org>
Reviewed by: Davi Arnaut
Backport: 543333

Modified:
    apr/apr/branches/1.2.x/locks/win32/proc_mutex.c

Modified: apr/apr/branches/1.2.x/locks/win32/proc_mutex.c
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.2.x/locks/win32/proc_mutex.c?view=diff&rev=543334&r1=543333&r2=543334
==============================================================================
--- apr/apr/branches/1.2.x/locks/win32/proc_mutex.c (original)
+++ apr/apr/branches/1.2.x/locks/win32/proc_mutex.c Thu May 31 17:13:57 2007
@@ -98,6 +98,14 @@
      */
     mutexkey = res_name_from_filename(fname, 1, pool);
 
+#if defined(_WIN32_WCE)
+    hMutex = CreateMutex(NULL, FALSE, mutexkey);
+    if (hMutex && ERROR_ALREADY_EXISTS != GetLastError()) {
+        CloseHandle(hMutex);
+        hMutex = NULL;
+        SetLastError(ERROR_FILE_NOT_FOUND);
+    }
+#else
 #if APR_HAS_UNICODE_FS
     IF_WIN_OS_IS_UNICODE
     {
@@ -109,6 +117,7 @@
     {
         hMutex = OpenMutexA(MUTEX_ALL_ACCESS, FALSE, mutexkey);
     }
+#endif
 #endif
 
     if (!hMutex) {



Mime
View raw message