From 52a89d7c89d469d647c837705e4e72a9eb041332 Mon Sep 17 00:00:00 2001 From: bjh Date: Mon, 4 Jul 2005 09:29:09 +0000 Subject: 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 --- file_io/os2/open.c | 10 ++++------ 1 file 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; } } -- cgit v1.2.1