diff options
author | trawick <trawick@13f79535-47bb-0310-9956-ffa450edef68> | 2013-11-02 11:17:54 +0000 |
---|---|---|
committer | trawick <trawick@13f79535-47bb-0310-9956-ffa450edef68> | 2013-11-02 11:17:54 +0000 |
commit | d85fa3e6a7cdc6659e2aefc2d7af75722d58fd4a (patch) | |
tree | 06bbe9c92b2c2fd7b966352a0c8bbff633393a9d /file_io | |
parent | a3cdac7e8af14f39bce15d1e875c97370d8c5326 (diff) | |
download | libapr-d85fa3e6a7cdc6659e2aefc2d7af75722d58fd4a.tar.gz |
APR_FOPEN_NONBLOCK is expected to be critical for an app
that uses it; return APR_ENOTIMPL instead of ignoring it if
not supported.
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1538171 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'file_io')
-rw-r--r-- | file_io/os2/open.c | 4 | ||||
-rw-r--r-- | file_io/unix/open.c | 6 | ||||
-rw-r--r-- | file_io/win32/open.c | 3 |
3 files changed, 11 insertions, 2 deletions
diff --git a/file_io/os2/open.c b/file_io/os2/open.c index cd629dc8e..996e68bb9 100644 --- a/file_io/os2/open.c +++ b/file_io/os2/open.c @@ -38,6 +38,10 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname, apr ULONG action; apr_file_t *dafile = (apr_file_t *)apr_pcalloc(pool, sizeof(apr_file_t)); + if (flag & APR_FOPEN_NONBLOCK) { + return APR_ENOTIMPL; + } + dafile->pool = pool; dafile->isopen = FALSE; dafile->eof_hit = FALSE; diff --git a/file_io/unix/open.c b/file_io/unix/open.c index b7e5bd898..1e7b51183 100644 --- a/file_io/unix/open.c +++ b/file_io/unix/open.c @@ -136,11 +136,13 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, } #endif -#ifdef O_NONBLOCK if (flag & APR_FOPEN_NONBLOCK) { +#ifdef O_NONBLOCK oflags |= O_NONBLOCK; - } +#else + return APR_ENOTIMPL; #endif + } #ifdef O_CLOEXEC /* Introduced in Linux 2.6.23. Silently ignored on earlier Linux kernels. diff --git a/file_io/win32/open.c b/file_io/win32/open.c index 55397ca69..b668645bb 100644 --- a/file_io/win32/open.c +++ b/file_io/win32/open.c @@ -329,6 +329,9 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname, DWORD sharemode = FILE_SHARE_READ | FILE_SHARE_WRITE; apr_status_t rv; + if (flag & APR_FOPEN_NONBLOCK) { + return APR_ENOTIMPL; + } if (flag & APR_FOPEN_READ) { oflags |= GENERIC_READ; } |