diff options
author | trawick <trawick@13f79535-47bb-0310-9956-ffa450edef68> | 2013-10-23 00:19:36 +0000 |
---|---|---|
committer | trawick <trawick@13f79535-47bb-0310-9956-ffa450edef68> | 2013-10-23 00:19:36 +0000 |
commit | 28e1d9dfddfbbdddadbe122d7788ea51e8b471ae (patch) | |
tree | bdace55b822258a1a7d07f52935140736b573218 /file_io/unix | |
parent | 197bf3330c7d8bc4964001a8dc5d62d825a510ab (diff) | |
download | libapr-28e1d9dfddfbbdddadbe122d7788ea51e8b471ae.tar.gz |
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
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1534873 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'file_io/unix')
-rw-r--r-- | file_io/unix/open.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/file_io/unix/open.c b/file_io/unix/open.c index 36be4a706..b7e5bd898 100644 --- a/file_io/unix/open.c +++ b/file_io/unix/open.c @@ -97,7 +97,7 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, 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(apr_file_t **new, 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; |