apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mladen Turk" <mt...@apache.org>
Subject [PATCH] WIN32 filedup
Date Mon, 31 Mar 2003 15:52:29 GMT
Hi,

The WIN32 version of apr_file_dup is missing the create_mutex call.
This make duplicated file unusable (the ap segfaults) if opened
with APR_APPEND flag.

Here is the patch:

RCS file: /home/cvspublic/apr/file_io/win32/filedup.c,v
retrieving revision 1.54
diff -u -3 -r1.54 filedup.c
--- filedup.c	7 Jan 2003 00:52:53 -0000	1.54
+++ filedup.c	31 Mar 2003 15:50:27 -0000
@@ -81,7 +81,9 @@
     (*new_file)->fname = apr_pstrdup(p, old_file->fname);
     (*new_file)->append = old_file->append;
     (*new_file)->buffered = FALSE;
-
+    if ((*new_file)->append)
+        apr_thread_mutex_create(&(*new_file)->mutex, 
+                                APR_THREAD_MUTEX_DEFAULT, p); 
     apr_pool_cleanup_register((*new_file)->pool, (void *)(*new_file),
file_cleanup,
                         apr_pool_cleanup_null);
 


MT.


Mime
View raw message