apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From traw...@apache.org
Subject svn commit: r1538171 - in /apr/apr/trunk: file_io/os2/open.c file_io/unix/open.c file_io/win32/open.c include/apr_file_io.h
Date Sat, 02 Nov 2013 11:17:55 GMT
Author: trawick
Date: Sat Nov  2 11:17:54 2013
New Revision: 1538171

URL: http://svn.apache.org/r1538171
Log:
APR_FOPEN_NONBLOCK is expected to be critical for an app
that uses it; return APR_ENOTIMPL instead of ignoring it if
not supported.

Modified:
    apr/apr/trunk/file_io/os2/open.c
    apr/apr/trunk/file_io/unix/open.c
    apr/apr/trunk/file_io/win32/open.c
    apr/apr/trunk/include/apr_file_io.h

Modified: apr/apr/trunk/file_io/os2/open.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/file_io/os2/open.c?rev=1538171&r1=1538170&r2=1538171&view=diff
==============================================================================
--- apr/apr/trunk/file_io/os2/open.c (original)
+++ apr/apr/trunk/file_io/os2/open.c Sat Nov  2 11:17:54 2013
@@ -38,6 +38,10 @@ APR_DECLARE(apr_status_t) apr_file_open(
     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;

Modified: apr/apr/trunk/file_io/unix/open.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/file_io/unix/open.c?rev=1538171&r1=1538170&r2=1538171&view=diff
==============================================================================
--- apr/apr/trunk/file_io/unix/open.c (original)
+++ apr/apr/trunk/file_io/unix/open.c Sat Nov  2 11:17:54 2013
@@ -136,11 +136,13 @@ APR_DECLARE(apr_status_t) apr_file_open(
     }
 #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.

Modified: apr/apr/trunk/file_io/win32/open.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/file_io/win32/open.c?rev=1538171&r1=1538170&r2=1538171&view=diff
==============================================================================
--- apr/apr/trunk/file_io/win32/open.c (original)
+++ apr/apr/trunk/file_io/win32/open.c Sat Nov  2 11:17:54 2013
@@ -329,6 +329,9 @@ APR_DECLARE(apr_status_t) apr_file_open(
     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;
     }

Modified: apr/apr/trunk/include/apr_file_io.h
URL: http://svn.apache.org/viewvc/apr/apr/trunk/include/apr_file_io.h?rev=1538171&r1=1538170&r2=1538171&view=diff
==============================================================================
--- apr/apr/trunk/include/apr_file_io.h (original)
+++ apr/apr/trunk/include/apr_file_io.h Sat Nov  2 11:17:54 2013
@@ -134,6 +134,10 @@ extern "C" {
  * if it was previously created and written without the sparse flag.
  * On platforms which do not understand, or on file systems which
  * cannot handle sparse files, the flag is ignored by apr_file_open().
+ *
+ * @def APR_FOPEN_NONBLOCK
+ * @warning APR_FOPEN_NONBLOCK is not implemented on all platforms.
+ * Callers should be prepared for it to fail with #APR_ENOTIMPL.
  */
 
 /** @} */



Mime
View raw message