commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mt...@apache.org
Subject svn commit: r820922 - in /commons/sandbox/runtime/trunk/src/main/native: include/acr_file.h os/unix/fsysio.c os/win32/fsysio.c
Date Fri, 02 Oct 2009 07:56:09 GMT
Author: mturk
Date: Fri Oct  2 07:56:08 2009
New Revision: 820922

URL: http://svn.apache.org/viewvc?rev=820922&view=rev
Log:
Get rid of file err field

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

Modified: commons/sandbox/runtime/trunk/src/main/native/include/acr_file.h
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/include/acr_file.h?rev=820922&r1=820921&r2=820922&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/include/acr_file.h (original)
+++ commons/sandbox/runtime/trunk/src/main/native/include/acr_file.h Fri Oct  2 07:56:08 2009
@@ -189,7 +189,6 @@
     acr_osd_t    fd;                    /**< Os file descriptor         */
     int          type;                  /**< File type. see ACR_FT      */
     int          eof;                   /**< Non zero if file hit EOF   */
-    int          err;                   /**< Last error value           */
     acr_uint32_t flags;                 /**< File flags                 */
     acr_time_t   timeout;               /**< I/O timeout                */
     acr_off_t    pos;                   /**< Current file pointer       */

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=820922&r1=820921&r2=820922&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 Fri Oct  2 07:56:08 2009
@@ -711,7 +711,6 @@
     }
     if (rd == 0) {
         ACR_DescriptorSetErrEx(_E, f->descriptor, 0);
-        f->err = 0;
         f->eof = 1;
         return  -1;
     }
@@ -719,7 +718,7 @@
         return (jint)rd;
 
     ACR_DescriptorSetErrEx(_E, f->descriptor, rc);
-    switch (f->err = rc) {
+    switch (rc) {
         case 0:
         case ACR_TIMEUP:
         break;
@@ -805,7 +804,7 @@
         return (jint)rd;
 
     ACR_DescriptorSetErrEx(_E, f->descriptor, rc);
-    switch (f->err = rc) {
+    switch (rc) {
         case 0:
             f->eof = 1;
         break;
@@ -873,7 +872,7 @@
         return (jint)rd;
 
     ACR_DescriptorSetErrEx(_E, f->descriptor, rc);
-    switch (f->err = rc) {
+    switch (rc) {
         case 0:
             f->eof = 1;
         break;
@@ -945,7 +944,7 @@
         return (jint)rd;
 
     ACR_DescriptorSetErrEx(_E, f->descriptor, rc);
-    switch (f->err = rc) {
+    switch (rc) {
         case 0:
             f->eof = 1;
         break;
@@ -995,7 +994,7 @@
         return (jint)wr;
 
     ACR_DescriptorSetErrEx(_E, f->descriptor, rc);
-    switch (f->err = rc) {
+    switch (rc) {
         case 0:
         case ACR_TIMEUP:
             return 0;
@@ -1035,7 +1034,7 @@
     if (!bb) {
         return -1;
     }
-    f->err = 0;
+
     wr = r_write(f->fd, bb + po, cs);
     if (wr == -1 && (errno == EAGAIN || errno == EWOULDBLOCK) &&
         f->timeout != 0) {
@@ -1053,7 +1052,7 @@
         return (jint)wr;
 
     ACR_DescriptorSetErrEx(_E, f->descriptor, rc);
-    switch (f->err = rc) {
+    switch (rc) {
         case 0:
         case ACR_TIMEUP:
             return 0;
@@ -1115,7 +1114,7 @@
         return (jint)wr;
 
     ACR_DescriptorSetErrEx(_E, f->descriptor, rc);
-    switch (f->err = rc) {
+    switch (rc) {
         case 0:
         case ACR_TIMEUP:
             return 0;
@@ -1182,7 +1181,7 @@
         return (jint)wr;
 
     ACR_DescriptorSetErrEx(_E, f->descriptor, rc);
-    switch (f->err = rc) {
+    switch (rc) {
         case 0:
         case ACR_TIMEUP:
             return 0;
@@ -1278,7 +1277,7 @@
         return (jint)wr;
 
     ACR_DescriptorSetErrEx(_E, f->descriptor, rc);
-    switch (f->err = rc) {
+    switch (rc) {
         case 0:
         case ACR_TIMEUP:
             return 0;
@@ -1357,7 +1356,7 @@
         return (jint)wr;
 
     ACR_DescriptorSetErrEx(_E, f->descriptor, rc);
-    switch (f->err = rc) {
+    switch (rc) {
         case 0:
         case ACR_TIMEUP:
             return 0;
@@ -1425,7 +1424,7 @@
         return (jint)wt;
 
     ACR_DescriptorSetErrEx(_E, f->descriptor, rc);
-    switch (f->err = rc) {
+    switch (rc) {
         case 0:
         case ACR_TIMEUP:
             return 0;
@@ -1497,7 +1496,7 @@
         return (jint)wt;
 
     ACR_DescriptorSetErrEx(_E, f->descriptor, rc);
-    switch (f->err = rc) {
+    switch (rc) {
         case 0:
         case ACR_TIMEUP:
             return 0;
@@ -1574,7 +1573,7 @@
         return (jint)wt;
 
     ACR_DescriptorSetErrEx(_E, f->descriptor, rc);
-    switch (f->err = rc) {
+    switch (rc) {
         case 0:
         case ACR_TIMEUP:
             return 0;

Modified: commons/sandbox/runtime/trunk/src/main/native/os/win32/fsysio.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/os/win32/fsysio.c?rev=820922&r1=820921&r2=820922&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/os/win32/fsysio.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/os/win32/fsysio.c Fri Oct  2 07:56:08 2009
@@ -830,7 +830,6 @@
             }
             else {
                 if (rd == 0) {
-                    f->err = ACR_TIMEUP;
                     ACR_DescriptorSetErrEx(_E, f->descriptor, ACR_TIMEUP);
                     return -1;
                 }
@@ -865,7 +864,6 @@
         case ERROR_IO_PENDING:
             switch (rc = overlapped_wait(f, &rd)) {
                 case 0:
-                    f->err = 0;
                     if (rd) {
                         f->pos += rd;
                         return c;
@@ -889,7 +887,7 @@
         return -1;
 
     ACR_DescriptorSetErrEx(_E, f->descriptor, rc);
-    switch (f->err = rc) {
+    switch (rc) {
         case 0:
         case ACR_TIMEUP:
         case ERROR_OPERATION_ABORTED:
@@ -947,7 +945,6 @@
             }
             else {
                 if (rd == 0) {
-                    f->err = ACR_TIMEUP;
                     ACR_DescriptorSetErrEx(_E, f->descriptor, ACR_TIMEUP);
                     return 0;
                 }
@@ -1046,7 +1043,7 @@
         return -1;
 
     ACR_DescriptorSetErrEx(_E, f->descriptor, rc);
-    switch (f->err = rc) {
+    switch (rc) {
         case 0:
         case ACR_TIMEUP:
         case ERROR_OPERATION_ABORTED:
@@ -1103,7 +1100,6 @@
             }
             else {
                 if (rd == 0) {
-                    f->err = ACR_TIMEUP;
                     ACR_DescriptorSetErrEx(_E, f->descriptor, ACR_TIMEUP);
                     return 0;
                 }
@@ -1145,7 +1141,7 @@
             f->eof = 1;
         goto finally;
     }
-    switch (f->err = GetLastError()) {
+    switch (rc = GetLastError()) {
         case ERROR_HANDLE_EOF:
         case ERROR_BROKEN_PIPE:
             rc     = 0;
@@ -1181,7 +1177,7 @@
         return -1;
 
     ACR_DescriptorSetErrEx(_E, f->descriptor, rc);
-    switch (f->err = rc) {
+    switch (rc) {
         case 0:
         case ACR_TIMEUP:
         case ERROR_OPERATION_ABORTED:
@@ -1240,7 +1236,6 @@
             }
             else {
                 if (rd == 0) {
-                    f->err = ACR_TIMEUP;
                     ACR_DescriptorSetErrEx(_E, f->descriptor, ACR_TIMEUP);
                     return 0;
                 }
@@ -1284,7 +1279,7 @@
             f->eof = 1;
         goto finally;
     }
-    switch (f->err = GetLastError()) {
+    switch (rc = GetLastError()) {
         case ERROR_HANDLE_EOF:
         case ERROR_BROKEN_PIPE:
             rc     = 0;
@@ -1293,7 +1288,6 @@
         case ERROR_IO_PENDING:
             switch (rc = overlapped_wait(f, &rd)) {
                 case 0:
-                    f->err = 0;
                     if (rd) {
                         f->pos += rd;
                         goto finally;
@@ -1321,7 +1315,7 @@
         return -1;
 
     ACR_DescriptorSetErrEx(_E, f->descriptor, rc);
-    switch (f->err = rc) {
+    switch (rc) {
         case 0:
         case ACR_TIMEUP:
         case ERROR_OPERATION_ABORTED:
@@ -1424,7 +1418,7 @@
         return (jint)wr;
 
     ACR_DescriptorSetErrEx(_E, f->descriptor, rc);
-    switch (f->err = rc) {
+    switch (rc) {
         case 0:
         case ACR_TIMEUP:
         case ERROR_OPERATION_ABORTED:
@@ -1434,7 +1428,7 @@
             ACR_THROW_EX_IF_ERR(ACR_EX_ACLOSED_DESC, rc);
         break;
         default:
-            ACR_THROW_IO_IF_ERR(f->err);
+            ACR_THROW_IO_IF_ERR(rc);
         break;
     }
     return -1;
@@ -1540,7 +1534,7 @@
         return (jint)wr;
 
     ACR_DescriptorSetErrEx(_E, f->descriptor, rc);
-    switch (f->err = rc) {
+    switch (rc) {
         case 0:
         case ACR_TIMEUP:
         case ERROR_OPERATION_ABORTED:
@@ -1550,7 +1544,7 @@
             ACR_THROW_EX_IF_ERR(ACR_EX_ACLOSED_DESC, rc);
         break;
         default:
-            ACR_THROW_IO_IF_ERR(f->err);
+            ACR_THROW_IO_IF_ERR(rc);
         break;
     }
     return -1;
@@ -1662,7 +1656,7 @@
         return (jint)wr;
 
     ACR_DescriptorSetErrEx(_E, f->descriptor, rc);
-    switch (f->err = rc) {
+    switch (rc) {
         case 0:
         case ACR_TIMEUP:
         case ERROR_OPERATION_ABORTED:
@@ -1672,7 +1666,7 @@
             ACR_THROW_EX_IF_ERR(ACR_EX_ACLOSED_DESC, rc);
         break;
         default:
-            ACR_THROW_IO_IF_ERR(f->err);
+            ACR_THROW_IO_IF_ERR(rc);
         break;
     }
     return -1;
@@ -1788,7 +1782,7 @@
         return (jint)wr;
 
     ACR_DescriptorSetErrEx(_E, f->descriptor, rc);
-    switch (f->err = rc) {
+    switch (rc) {
         case 0:
         case ACR_TIMEUP:
         case ERROR_OPERATION_ABORTED:
@@ -1798,7 +1792,7 @@
             ACR_THROW_EX_IF_ERR(ACR_EX_ACLOSED_DESC, rc);
         break;
         default:
-            ACR_THROW_IO_IF_ERR(f->err);
+            ACR_THROW_IO_IF_ERR(rc);
         break;
     }
     return -1;
@@ -1877,7 +1871,7 @@
         }
     }
 
-    for (i = 0; i < cs, f->err == 0; i++) {
+    for (i = 0; i < cs, rc == 0; i++) {
         bae = (*_E)->GetObjectArrayElement(_E, vec, (jsize)(i + po));
         bal = (DWORD)(*_E)->GetArrayLength(_E, bae);
         bab = (*_E)->GetByteArrayElements(_E, bae, NULL);
@@ -1918,7 +1912,7 @@
         return (jint)nbytes;
 
     ACR_DescriptorSetErrEx(_E, f->descriptor, rc);
-    switch (f->err = rc) {
+    switch (rc) {
         case 0:
         case ACR_TIMEUP:
             return 0;
@@ -1927,7 +1921,7 @@
             ACR_THROW_EX_IF_ERR(ACR_EX_ACLOSED_DESC, rc);
         break;
         default:
-            ACR_THROW_IO_IF_ERR(f->err);
+            ACR_THROW_IO_IF_ERR(rc);
         break;
     }
     return -1;
@@ -2006,7 +2000,7 @@
         }
     }
 
-    for (i = 0; i < cs, f->err == 0; i++) {
+    for (i = 0; i < cs, rc == 0; i++) {
         bbe = (*_E)->GetObjectArrayElement(_E, vec, (jsize)(i + po));
         bbl = (DWORD)(*_E)->GetDirectBufferCapacity(_E, bbe);
         bbb = (*_E)->GetDirectBufferAddress(_E, bbe);
@@ -2047,7 +2041,7 @@
         return (jint)nbytes;
 
     ACR_DescriptorSetErrEx(_E, f->descriptor, rc);
-    switch (f->err = rc) {
+    switch (rc) {
         case 0:
         case ACR_TIMEUP:
         case ERROR_OPERATION_ABORTED:
@@ -2057,7 +2051,7 @@
             ACR_THROW_EX_IF_ERR(ACR_EX_ACLOSED_DESC, rc);
         break;
         default:
-            ACR_THROW_IO_IF_ERR(f->err);
+            ACR_THROW_IO_IF_ERR(rc);
         break;
     }
     return -1;
@@ -2177,7 +2171,7 @@
         return (jint)nbytes;
 
     ACR_DescriptorSetErrEx(_E, f->descriptor, rc);
-    switch (f->err = rc) {
+    switch (rc) {
         case 0:
         case ACR_TIMEUP:
             return 0;
@@ -2186,7 +2180,7 @@
             ACR_THROW_EX_IF_ERR(ACR_EX_ACLOSED_DESC, rc);
         break;
         default:
-            ACR_THROW_IO_IF_ERR(f->err);
+            ACR_THROW_IO_IF_ERR(rc);
         break;
     }
     return -1;
@@ -2309,7 +2303,7 @@
         return (jint)nbytes;
 
     ACR_DescriptorSetErrEx(_E, f->descriptor, rc);
-    switch (f->err = rc) {
+    switch (rc) {
         case 0:
         case ACR_TIMEUP:
         case ERROR_OPERATION_ABORTED:
@@ -2319,7 +2313,7 @@
             ACR_THROW_EX_IF_ERR(ACR_EX_ACLOSED_DESC, rc);
         break;
         default:
-            ACR_THROW_IO_IF_ERR(f->err);
+            ACR_THROW_IO_IF_ERR(rc);
         break;
     }
     return -1;
@@ -2447,7 +2441,7 @@
         return (jint)nbytes;
 
     ACR_DescriptorSetErrEx(_E, f->descriptor, rc);
-    switch (f->err = rc) {
+    switch (rc) {
         case 0:
         case ACR_TIMEUP:
         case ERROR_OPERATION_ABORTED:
@@ -2457,7 +2451,7 @@
             ACR_THROW_EX_IF_ERR(ACR_EX_ACLOSED_DESC, rc);
         break;
         default:
-            ACR_THROW_IO_IF_ERR(f->err);
+            ACR_THROW_IO_IF_ERR(rc);
         break;
     }
     return -1;



Mime
View raw message