apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From traw...@apache.org
Subject svn commit: r1538174 - in /apr/apr/branches/1.5.x: ./ 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:36:03 GMT
Author: trawick
Date: Sat Nov  2 11:36:02 2013
New Revision: 1538174

URL: http://svn.apache.org/r1538174
Log:
merge r1538171 from trunk:

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/branches/1.5.x/   (props changed)
    apr/apr/branches/1.5.x/file_io/os2/open.c
    apr/apr/branches/1.5.x/file_io/unix/open.c
    apr/apr/branches/1.5.x/file_io/win32/open.c
    apr/apr/branches/1.5.x/include/apr_file_io.h

Propchange: apr/apr/branches/1.5.x/
------------------------------------------------------------------------------
  Merged /apr/apr/trunk:r1538171

Modified: apr/apr/branches/1.5.x/file_io/os2/open.c
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.5.x/file_io/os2/open.c?rev=1538174&r1=1538173&r2=1538174&view=diff
==============================================================================
--- apr/apr/branches/1.5.x/file_io/os2/open.c (original)
+++ apr/apr/branches/1.5.x/file_io/os2/open.c Sat Nov  2 11:36:02 2013
@@ -38,6 +38,10 @@ APR_DECLARE(apr_status_t) apr_file_open(
     ULONG action;
     apr_file_t *dafile = (apr_file_t *)apr_palloc(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/branches/1.5.x/file_io/unix/open.c
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.5.x/file_io/unix/open.c?rev=1538174&r1=1538173&r2=1538174&view=diff
==============================================================================
--- apr/apr/branches/1.5.x/file_io/unix/open.c (original)
+++ apr/apr/branches/1.5.x/file_io/unix/open.c Sat Nov  2 11:36:02 2013
@@ -135,11 +135,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/branches/1.5.x/file_io/win32/open.c
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.5.x/file_io/win32/open.c?rev=1538174&r1=1538173&r2=1538174&view=diff
==============================================================================
--- apr/apr/branches/1.5.x/file_io/win32/open.c (original)
+++ apr/apr/branches/1.5.x/file_io/win32/open.c Sat Nov  2 11:36:02 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/branches/1.5.x/include/apr_file_io.h
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.5.x/include/apr_file_io.h?rev=1538174&r1=1538173&r2=1538174&view=diff
==============================================================================
--- apr/apr/branches/1.5.x/include/apr_file_io.h (original)
+++ apr/apr/branches/1.5.x/include/apr_file_io.h Sat Nov  2 11:36:02 2013
@@ -127,6 +127,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