summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbjh <bjh@13f79535-47bb-0310-9956-ffa450edef68>2005-07-04 09:28:25 +0000
committerbjh <bjh@13f79535-47bb-0310-9956-ffa450edef68>2005-07-04 09:28:25 +0000
commit34f263161c90195c68d5d5cf9c4de7f68fbedb06 (patch)
tree1f3dcddfa5bd984aeace5dd92d17cb78a221c203
parent0000adf31d88e3ad936a15d658921daaa9b00081 (diff)
downloadlibapr-34f263161c90195c68d5d5cf9c4de7f68fbedb06.tar.gz
Bug #33844: OS/2: file opened with APR_CREATE would be truncated if APR_APPEND
wasn't also given. Backport from trunk of r180013 git-svn-id: http://svn.apache.org/repos/asf/apr/apr/branches/1.1.x@209045 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--file_io/os2/open.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/file_io/os2/open.c b/file_io/os2/open.c
index 910084ef6..3b9760425 100644
--- a/file_io/os2/open.c
+++ b/file_io/os2/open.c
@@ -67,12 +67,10 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname, apr
}
if (flag & APR_CREATE) {
- oflags |= OPEN_ACTION_CREATE_IF_NEW;
- if (!(flag & APR_EXCL)) {
- if (flag & APR_APPEND)
- oflags |= OPEN_ACTION_OPEN_IF_EXISTS;
- else
- oflags |= OPEN_ACTION_REPLACE_IF_EXISTS;
+ oflags |= OPEN_ACTION_CREATE_IF_NEW;
+
+ if (!(flag & APR_EXCL) && !(flag & APR_TRUNCATE)) {
+ oflags |= OPEN_ACTION_OPEN_IF_EXISTS;
}
}