summaryrefslogtreecommitdiff
path: root/file_io/win32
diff options
context:
space:
mode:
authorivan <ivan@13f79535-47bb-0310-9956-ffa450edef68>2019-05-26 08:46:08 +0000
committerivan <ivan@13f79535-47bb-0310-9956-ffa450edef68>2019-05-26 08:46:08 +0000
commit8620f7e0b1a66debb05378b09e007e86d03a4432 (patch)
tree0ee027b936b7b1952b494adfead4b121d0e32ca5 /file_io/win32
parent06a84cb6acfb0640262781fedc1cdb0f7861c6b4 (diff)
downloadlibapr-8620f7e0b1a66debb05378b09e007e86d03a4432.tar.gz
* file_io/win32/readwrite.c
(apr_file_write): Use CancelIoEx() instead of CancelIo() to protect from potential race condition. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1860038 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'file_io/win32')
-rw-r--r--file_io/win32/open.c2
-rw-r--r--file_io/win32/readwrite.c4
2 files changed, 3 insertions, 3 deletions
diff --git a/file_io/win32/open.c b/file_io/win32/open.c
index b6c01432e..f3b93f5ae 100644
--- a/file_io/win32/open.c
+++ b/file_io/win32/open.c
@@ -260,7 +260,7 @@ static apr_status_t make_sparse_file(apr_file_t *file)
} while (res == WAIT_ABANDONED);
if (res != WAIT_OBJECT_0) {
- CancelIo(file->filehand);
+ CancelIoEx(file->filehand, file->pOverlapped);
}
if (GetOverlappedResult(file->filehand, file->pOverlapped,
diff --git a/file_io/win32/readwrite.c b/file_io/win32/readwrite.c
index 96222d8e4..ef3f7ad85 100644
--- a/file_io/win32/readwrite.c
+++ b/file_io/win32/readwrite.c
@@ -99,7 +99,7 @@ static apr_status_t read_with_timeout(apr_file_t *file, void *buf, apr_size_t le
* the operation in progress.
*/
if (res != WAIT_OBJECT_0) {
- CancelIo(file->filehand);
+ CancelIoEx(file->filehand, file->pOverlapped);
}
/* Ignore any failures above. Attempt to complete
@@ -523,7 +523,7 @@ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, a
break;
}
if (rv != APR_SUCCESS) {
- CancelIo(thefile->filehand);
+ CancelIoEx(thefile->filehand, thefile->pOverlapped);
}
}
}