commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mt...@apache.org
Subject svn commit: r821701 - /commons/sandbox/runtime/trunk/src/main/native/shared/descriptor.c
Date Mon, 05 Oct 2009 06:54:21 GMT
Author: mturk
Date: Mon Oct  5 06:54:20 2009
New Revision: 821701

URL: http://svn.apache.org/viewvc?rev=821701&view=rev
Log:
Callbacks retun ENOTIMPL, not EINVAL if sync of flush is unsupported

Modified:
    commons/sandbox/runtime/trunk/src/main/native/shared/descriptor.c

Modified: commons/sandbox/runtime/trunk/src/main/native/shared/descriptor.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/shared/descriptor.c?rev=821701&r1=821700&r2=821701&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/shared/descriptor.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/shared/descriptor.c Mon Oct  5 06:54:20
2009
@@ -21,6 +21,7 @@
 
 #include "acr.h"
 #include "acr_private.h"
+#include "acr_arch.h"
 #include "acr_error.h"
 #include "acr_clazz.h"
 #include "acr_string.h"
@@ -173,7 +174,7 @@
             cb.data = GET_IFIELD_O(0006, _O);
             if ((rc = (*handler)(_E, _O, ACR_DESC_CLOSE, &cb))) {
                 /* Throw IOException with errno message */
-                ACR_ThrowException(_E, THROW_FMARK, ACR_EX_EIO, rc);
+                ACR_THROW_IO_IF_ERR(rc);
             }
         }
     }
@@ -220,10 +221,12 @@
             cb.thiz = _O;
             cb.data = GET_IFIELD_O(0006, _O);
             if ((rc = (*handler)(_E, _O, ACR_DESC_SYNC, &cb))) {
-                if (rc == ACR_EINVAL)
-                    ACR_ThrowException(_E, THROW_NMARK, ACR_EX_ESYNC, 0);
-                else
-                    ACR_ThrowException(_E, THROW_FMARK, ACR_EX_EIO, rc);
+                if (rc == ACR_ENOTIMPL) {
+                    ACR_THROW_EX_IF_ERR(ACR_EX_ESYNC, rc);
+                }
+                else {
+                    ACR_THROW_IO_IF_ERR(rc);
+                }
             }
         }
     }
@@ -247,10 +250,12 @@
             cb.thiz = _O;
             cb.data = GET_IFIELD_O(0006, _O);
             if ((rc = (*handler)(_E, _O, ACR_DESC_FLUSH, &cb))) {
-                if (rc == ACR_EINVAL)
-                    ACR_ThrowException(_E, THROW_NMARK, ACR_EX_ESYNC, 0);
-                else
-                    ACR_ThrowException(_E, THROW_FMARK, ACR_EX_EIO, rc);
+                if (rc == ACR_ENOTIMPL) {
+                    ACR_THROW_EX_IF_ERR(ACR_EX_ESYNC, rc);
+                }
+                else {
+                    ACR_THROW_IO_IF_ERR(rc);
+                }
             }
         }
     }



Mime
View raw message