You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by tr...@apache.org on 2013/10/23 02:19:37 UTC
svn commit: r1534873 - /apr/apr/trunk/file_io/unix/open.c
Author: trawick
Date: Wed Oct 23 00:19:36 2013
New Revision: 1534873
URL: http://svn.apache.org/r1534873
Log:
clang scan-build noted that we sometimes assigned garbage
to the mutex field, since the conditions under which we
got the mutex vs. accessed it were different; simplify
Modified:
apr/apr/trunk/file_io/unix/open.c
Modified: apr/apr/trunk/file_io/unix/open.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/file_io/unix/open.c?rev=1534873&r1=1534872&r2=1534873&view=diff
==============================================================================
--- apr/apr/trunk/file_io/unix/open.c (original)
+++ apr/apr/trunk/file_io/unix/open.c Wed Oct 23 00:19:36 2013
@@ -97,7 +97,7 @@ APR_DECLARE(apr_status_t) apr_file_open(
apr_os_file_t fd;
int oflags = 0;
#if APR_HAS_THREADS
- apr_thread_mutex_t *thlock;
+ apr_thread_mutex_t *thlock = NULL;
#endif
apr_status_t rv;
@@ -217,16 +217,15 @@ APR_DECLARE(apr_status_t) apr_file_open(
if ((*new)->buffered) {
(*new)->buffer = apr_palloc(pool, APR_FILE_DEFAULT_BUFSIZE);
(*new)->bufsize = APR_FILE_DEFAULT_BUFSIZE;
-#if APR_HAS_THREADS
- if ((*new)->flags & APR_FOPEN_XTHREAD) {
- (*new)->thlock = thlock;
- }
-#endif
}
else {
(*new)->buffer = NULL;
}
+#if APR_HAS_THREADS
+ (*new)->thlock = thlock;
+#endif
+
(*new)->is_pipe = 0;
(*new)->timeout = -1;
(*new)->ungetchar = -1;