You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by mt...@apache.org on 2009/09/29 11:25:03 UTC

svn commit: r819866 - in /commons/sandbox/runtime/trunk/src/main/native: include/arch/unix/acr_arch.h os/unix/fsysio.c

Author: mturk
Date: Tue Sep 29 09:25:01 2009
New Revision: 819866

URL: http://svn.apache.org/viewvc?rev=819866&view=rev
Log:
Use other variant of O_NONBLOCK

Modified:
    commons/sandbox/runtime/trunk/src/main/native/include/arch/unix/acr_arch.h
    commons/sandbox/runtime/trunk/src/main/native/os/unix/fsysio.c

Modified: commons/sandbox/runtime/trunk/src/main/native/include/arch/unix/acr_arch.h
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/include/arch/unix/acr_arch.h?rev=819866&r1=819865&r2=819866&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/include/arch/unix/acr_arch.h (original)
+++ commons/sandbox/runtime/trunk/src/main/native/include/arch/unix/acr_arch.h Tue Sep 29 09:25:01 2009
@@ -62,6 +62,14 @@
 #define IS_INVALID_MEMORY(h) (((h) == NULL || (h) == INVALID_MEMORY_VALUE))
 #define IS_VALID_MEMORY(h)   (((h) != NULL && (h) != INVALID_MEMORY_VALUE))
 
+#if !defined(O_NONBLOCK)
+#if  defined(O_NDELAY)
+#define O_NONBLOCK  O_NDELAY
+#elif defined(O_FNDELAY)
+#define O_NONBLOCK  O_FNDELAY
+#endif
+#endif
+
 /** Common large file replacement macros
  */
 #if defined(DARWIN) && DARWIN >= 1000

Modified: commons/sandbox/runtime/trunk/src/main/native/os/unix/fsysio.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/os/unix/fsysio.c?rev=819866&r1=819865&r2=819866&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/os/unix/fsysio.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/os/unix/fsysio.c Tue Sep 29 09:25:01 2009
@@ -144,8 +144,9 @@
             goto finally;
         }
     }
-#ifdef O_NONBLOCK
+
     if (flags & ACR_FOPEN_NONBLOCK) {
+#ifdef O_NONBLOCK
         /* Use non-blocking I/O
          */
         int mode;
@@ -158,8 +159,13 @@
             rc = ACR_GET_OS_ERROR();
             goto finally;
         }
-    }
+#else
+        /* Non blocking files are unsupported.
+         */
+        rc = ACR_ENOTIMPL;
+        goto finally;
 #endif
+    }
     fp = ACR_CALLOC(acr_file_t, 1);
     if (!fp) {
         rc = ACR_ENOMEM;