diff options
author | William A. Rowe Jr <wrowe@apache.org> | 2006-03-10 22:55:49 +0000 |
---|---|---|
committer | William A. Rowe Jr <wrowe@apache.org> | 2006-03-10 22:55:49 +0000 |
commit | 02b57c4424ec51551dd6f4a069108fa3594fa364 (patch) | |
tree | 93a08ae76a7ffbe0cdf1acc74768274c5805f461 | |
parent | 4465515280ea46b89635e6b6ef268ff851a35976 (diff) | |
download | apr-02b57c4424ec51551dd6f4a069108fa3594fa364.tar.gz |
Identify - one 2Xtransformed error result, several missing mutex sections
and fix one last apr_file_flush result ignored (close the file, but return
the failure to flush error.)
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@384941 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | file_io/os2/filestat.c | 1 | ||||
-rw-r--r-- | file_io/os2/open.c | 7 | ||||
-rw-r--r-- | file_io/os2/readwrite.c | 1 | ||||
-rw-r--r-- | file_io/os2/seek.c | 1 |
4 files changed, 8 insertions, 2 deletions
diff --git a/file_io/os2/filestat.c b/file_io/os2/filestat.c index e6410e254..259acfa1b 100644 --- a/file_io/os2/filestat.c +++ b/file_io/os2/filestat.c @@ -94,6 +94,7 @@ APR_DECLARE(apr_status_t) apr_file_info_get(apr_finfo_t *finfo, apr_int32_t want if (thefile->isopen) { if (thefile->buffered) { + /* XXX: flush here is not mutex protected */ apr_status_t rv = apr_file_flush(thefile); if (rv != APR_SUCCESS) { diff --git a/file_io/os2/open.c b/file_io/os2/open.c index 4b1666bdc..ed2a11e75 100644 --- a/file_io/os2/open.c +++ b/file_io/os2/open.c @@ -121,16 +121,19 @@ APR_DECLARE(apr_status_t) apr_file_close(apr_file_t *file) apr_status_t status; if (file && file->isopen) { - apr_file_flush(file); + /* XXX: flush here is not mutex protected */ + status = apr_file_flush(file); rc = DosClose(file->filedes); if (rc == 0) { file->isopen = FALSE; - status = APR_SUCCESS; if (file->flags & APR_DELONCLOSE) { status = APR_FROM_OS_ERROR(DosDelete(file->fname)); } + /* else we return the status of the flush attempt + * when all else succeeds + */ } else { return APR_FROM_OS_ERROR(rc); } diff --git a/file_io/os2/readwrite.c b/file_io/os2/readwrite.c index fde47589e..d2b09bf60 100644 --- a/file_io/os2/readwrite.c +++ b/file_io/os2/readwrite.c @@ -150,6 +150,7 @@ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, a while (rc == 0 && size > 0) { if (thefile->bufpos == thefile->bufsize) // write buffer is full + /* XXX bug; - rc is double-transformed os->apr below */ rc = apr_file_flush(thefile); blocksize = size > thefile->bufsize - thefile->bufpos ? thefile->bufsize - thefile->bufpos : size; diff --git a/file_io/os2/seek.c b/file_io/os2/seek.c index 5918a7c75..bb1e97573 100644 --- a/file_io/os2/seek.c +++ b/file_io/os2/seek.c @@ -27,6 +27,7 @@ static apr_status_t setptr(apr_file_t *thefile, unsigned long pos ) ULONG rc; if (thefile->direction == 1) { + /* XXX: flush here is not mutex protected */ apr_status_t rv = apr_file_flush(thefile); if (rv != APR_SUCCESS) { |