summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbjh <bjh@13f79535-47bb-0310-9956-ffa450edef68>2005-07-04 09:29:09 +0000
committerbjh <bjh@13f79535-47bb-0310-9956-ffa450edef68>2005-07-04 09:29:09 +0000
commit52a89d7c89d469d647c837705e4e72a9eb041332 (patch)
tree65072b0399612c68ce92995cb5af383b0b325b6f
parentae0e833e9afb42456a0283fd3b1106f6a350ed1b (diff)
downloadlibapr-52a89d7c89d469d647c837705e4e72a9eb041332.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.0.x@209046 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 c288402d8..8d4a1ce41 100644
--- a/file_io/os2/open.c
+++ b/file_io/os2/open.c
@@ -66,12 +66,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;
}
}