summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwrowe <wrowe@13f79535-47bb-0310-9956-ffa450edef68>2007-06-01 00:13:57 +0000
committerwrowe <wrowe@13f79535-47bb-0310-9956-ffa450edef68>2007-06-01 00:13:57 +0000
commit15ee5f3f02ec7be3af515cbf1c31b206e7aaba41 (patch)
treeb07ee7b9cf12a6971600d76fcc42d0fbe5914a42
parente580942d7329b4e59f5ddae350a5026460c9d943 (diff)
downloadlibapr-15ee5f3f02ec7be3af515cbf1c31b206e7aaba41.tar.gz
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 git-svn-id: http://svn.apache.org/repos/asf/apr/apr/branches/1.2.x@543334 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--locks/win32/proc_mutex.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/locks/win32/proc_mutex.c b/locks/win32/proc_mutex.c
index 9620a60d0..e60d5609f 100644
--- a/locks/win32/proc_mutex.c
+++ b/locks/win32/proc_mutex.c
@@ -98,6 +98,14 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_child_init(apr_proc_mutex_t **mutex,
*/
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
{
@@ -110,6 +118,7 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_child_init(apr_proc_mutex_t **mutex,
hMutex = OpenMutexA(MUTEX_ALL_ACCESS, FALSE, mutexkey);
}
#endif
+#endif
if (!hMutex) {
return apr_get_os_error();