You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by jo...@apache.org on 2005/10/19 18:12:19 UTC

svn commit: r326597 - /apr/apr/trunk/file_io/unix/seek.c

Author: jorton
Date: Wed Oct 19 09:12:15 2005
New Revision: 326597

URL: http://svn.apache.org/viewcvs?rev=326597&view=rev
Log:
* file_io/unix/seek.c (setptr): Tidy up error handling a little; use
apr_status_t, use rv not rc, check lseek return value directly, use
explicit APR_SUCCESS.  No functional change.

Modified:
    apr/apr/trunk/file_io/unix/seek.c

Modified: apr/apr/trunk/file_io/unix/seek.c
URL: http://svn.apache.org/viewcvs/apr/apr/trunk/file_io/unix/seek.c?rev=326597&r1=326596&r2=326597&view=diff
==============================================================================
--- apr/apr/trunk/file_io/unix/seek.c (original)
+++ apr/apr/trunk/file_io/unix/seek.c Wed Oct 19 09:12:15 2005
@@ -19,12 +19,12 @@
 static apr_status_t setptr(apr_file_t *thefile, apr_off_t pos )
 {
     apr_off_t newbufpos;
-    int rc;
+    apr_status_t rv;
 
     if (thefile->direction == 1) {
-        rc = apr_file_flush(thefile);
-        if (rc) {
-            return rc;
+        rv = apr_file_flush(thefile);
+        if (rv) {
+            return rv;
         }
         thefile->bufpos = thefile->direction = thefile->dataRead = 0;
     }
@@ -32,22 +32,20 @@
     newbufpos = pos - (thefile->filePtr - thefile->dataRead);
     if (newbufpos >= 0 && newbufpos <= thefile->dataRead) {
         thefile->bufpos = newbufpos;
-        rc = 0;
+        rv = APR_SUCCESS;
     } 
     else {
-        rc = lseek(thefile->filedes, pos, SEEK_SET);
-
-        if (rc != -1 ) {
+        if (lseek(thefile->filedes, pos, SEEK_SET) != -1) {
             thefile->bufpos = thefile->dataRead = 0;
             thefile->filePtr = pos;
-            rc = 0;
+            rv = APR_SUCCESS;
         }
         else {
-            rc = errno;
+            rv = errno;
         }
     }
 
-    return rc;
+    return rv;
 }