diff options
author | Graham Leggett <minfrin@apache.org> | 2010-03-01 19:45:36 +0000 |
---|---|---|
committer | Graham Leggett <minfrin@apache.org> | 2010-03-01 19:45:36 +0000 |
commit | fac49c6fc02c0bf31d0616ec6d5f6899d19f403a (patch) | |
tree | 0a039379adc44161841962828d43e59402815489 /file_io/os2 | |
parent | 7b0b2b23e1a2b838b93c69d49254d8bca4dc2d42 (diff) | |
download | apr-fac49c6fc02c0bf31d0616ec6d5f6899d19f403a.tar.gz |
Use the APR_FOPEN_* constants instead of the deprecated APR_* constants
within the file_io code.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@917675 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'file_io/os2')
-rw-r--r-- | file_io/os2/filedup.c | 2 | ||||
-rw-r--r-- | file_io/os2/open.c | 30 | ||||
-rw-r--r-- | file_io/os2/readwrite.c | 2 |
3 files changed, 17 insertions, 17 deletions
diff --git a/file_io/os2/filedup.c b/file_io/os2/filedup.c index a9d0421e2..b1063f57c 100644 --- a/file_io/os2/filedup.c +++ b/file_io/os2/filedup.c @@ -112,7 +112,7 @@ APR_DECLARE(apr_status_t) apr_file_setaside(apr_file_t **new_file, (*new_file)->fname = apr_pstrdup(p, old_file->fname); } - if (!(old_file->flags & APR_FILE_NOCLEANUP)) { + if (!(old_file->flags & APR_FOPEN_NOCLEANUP)) { apr_pool_cleanup_register(p, (void *)(*new_file), apr_file_cleanup, apr_file_cleanup); diff --git a/file_io/os2/open.c b/file_io/os2/open.c index 386bd073c..a1a55202f 100644 --- a/file_io/os2/open.c +++ b/file_io/os2/open.c @@ -45,18 +45,18 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname, apr dafile->flags = flag; dafile->blocking = BLK_ON; - if ((flag & APR_READ) && (flag & APR_WRITE)) { + if ((flag & APR_FOPEN_READ) && (flag & APR_FOPEN_WRITE)) { mflags |= OPEN_ACCESS_READWRITE; - } else if (flag & APR_READ) { + } else if (flag & APR_FOPEN_READ) { mflags |= OPEN_ACCESS_READONLY; - } else if (flag & APR_WRITE) { + } else if (flag & APR_FOPEN_WRITE) { mflags |= OPEN_ACCESS_WRITEONLY; } else { dafile->filedes = -1; return APR_EACCES; } - dafile->buffered = (flag & APR_BUFFERED) > 0; + dafile->buffered = (flag & APR_FOPEN_BUFFERED) > 0; if (dafile->buffered) { dafile->buffer = apr_palloc(pool, APR_FILE_DEFAULT_BUFSIZE); @@ -67,18 +67,18 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname, apr return rv; } - if (flag & APR_CREATE) { + if (flag & APR_FOPEN_CREATE) { oflags |= OPEN_ACTION_CREATE_IF_NEW; - if (!(flag & APR_EXCL) && !(flag & APR_TRUNCATE)) { + if (!(flag & APR_FOPEN_EXCL) && !(flag & APR_FOPEN_TRUNCATE)) { oflags |= OPEN_ACTION_OPEN_IF_EXISTS; } } - if ((flag & APR_EXCL) && !(flag & APR_CREATE)) + if ((flag & APR_FOPEN_EXCL) && !(flag & APR_FOPEN_CREATE)) return APR_EACCES; - if (flag & APR_TRUNCATE) { + if (flag & APR_FOPEN_TRUNCATE) { oflags |= OPEN_ACTION_REPLACE_IF_EXISTS; } else if ((oflags & 0xFF) == 0) { oflags |= OPEN_ACTION_OPEN_IF_EXISTS; @@ -86,7 +86,7 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname, apr rv = DosOpen(fname, &(dafile->filedes), &action, 0, 0, oflags, mflags, NULL); - if (rv == 0 && (flag & APR_APPEND)) { + if (rv == 0 && (flag & APR_FOPEN_APPEND)) { ULONG newptr; rv = DosSetFilePtr(dafile->filedes, 0, FILE_END, &newptr ); @@ -105,7 +105,7 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname, apr dafile->direction = 0; dafile->pipe = FALSE; - if (!(flag & APR_FILE_NOCLEANUP)) { + if (!(flag & APR_FOPEN_NOCLEANUP)) { apr_pool_cleanup_register(dafile->pool, dafile, apr_file_cleanup, apr_file_cleanup); } @@ -128,7 +128,7 @@ APR_DECLARE(apr_status_t) apr_file_close(apr_file_t *file) if (rc == 0) { file->isopen = FALSE; - if (file->flags & APR_DELONCLOSE) { + if (file->flags & APR_FOPEN_DELONCLOSE) { status = APR_FROM_OS_ERROR(DosDelete(file->fname)); } /* else we return the status of the flush attempt @@ -192,7 +192,7 @@ APR_DECLARE(apr_status_t) apr_os_file_put(apr_file_t **file, apr_os_file_t *thef (*file)->eof_hit = FALSE; (*file)->flags = flags; (*file)->pipe = FALSE; - (*file)->buffered = (flags & APR_BUFFERED) > 0; + (*file)->buffered = (flags & APR_FOPEN_BUFFERED) > 0; if ((*file)->buffered) { apr_status_t rv; @@ -224,7 +224,7 @@ APR_DECLARE(apr_status_t) apr_file_open_flags_stderr(apr_file_t **thefile, { apr_os_file_t fd = 2; - return apr_os_file_put(thefile, &fd, flags | APR_WRITE, pool); + return apr_os_file_put(thefile, &fd, flags | APR_FOPEN_WRITE, pool); } @@ -234,7 +234,7 @@ APR_DECLARE(apr_status_t) apr_file_open_flags_stdout(apr_file_t **thefile, { apr_os_file_t fd = 1; - return apr_os_file_put(thefile, &fd, flags | APR_WRITE, pool); + return apr_os_file_put(thefile, &fd, flags | APR_FOPEN_WRITE, pool); } @@ -244,7 +244,7 @@ APR_DECLARE(apr_status_t) apr_file_open_flags_stdin(apr_file_t **thefile, { apr_os_file_t fd = 0; - return apr_os_file_put(thefile, &fd, flags | APR_READ, pool); + return apr_os_file_put(thefile, &fd, flags | APR_FOPEN_READ, pool); } diff --git a/file_io/os2/readwrite.c b/file_io/os2/readwrite.c index a7b591b36..9c44ee0e0 100644 --- a/file_io/os2/readwrite.c +++ b/file_io/os2/readwrite.c @@ -163,7 +163,7 @@ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, a apr_thread_mutex_unlock(thefile->mutex); return APR_FROM_OS_ERROR(rc); } else { - if (thefile->flags & APR_APPEND) { + if (thefile->flags & APR_FOPEN_APPEND) { FILELOCK all = { 0, 0x7fffffff }; ULONG newpos; rc = DosSetFileLocks(thefile->filedes, NULL, &all, -1, 0); |