apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Trawick <traw...@attglobal.net>
Subject Re: cvs commit: apr/file_io/unix seek.c
Date Tue, 12 Mar 2002 01:57:53 GMT
trawick@apache.org writes:

> trawick     02/03/11 14:17:29
> 
>   Modified:    .        CHANGES
>                file_io/unix seek.c
>   Log:
>   fix a problem in apr_file_seek on Unix for buffered files

>   Index: seek.c
>   ===================================================================
>   RCS file: /home/cvs/apr/file_io/unix/seek.c,v
>   retrieving revision 1.24
>   retrieving revision 1.25
>   diff -u -r1.24 -r1.25
>   --- seek.c	28 Aug 2001 16:41:14 -0000	1.24
>   +++ seek.c	11 Mar 2002 22:17:29 -0000	1.25
>   @@ -74,6 +74,7 @@
>    
>            if (rc != -1 ) {
>                thefile->bufpos = thefile->dataRead = 0;
>   +            thefile->filePtr = pos;
>                rc = 0;
>            }
>            else {

The following changes may be appropriate for Win32 and OS/2:

Index: file_io/os2/seek.c
===================================================================
RCS file: /home/cvspublic/apr/file_io/os2/seek.c,v
retrieving revision 1.19
diff -u -r1.19 seek.c
--- file_io/os2/seek.c	28 Aug 2001 16:41:14 -0000	1.19
+++ file_io/os2/seek.c	12 Mar 2002 01:58:29 -0000
@@ -76,8 +76,10 @@
     } else {
         rc = DosSetFilePtr(thefile->filedes, pos, FILE_BEGIN, &thefile->filePtr
);
 
-        if ( !rc )
+        if ( !rc ) {
             thefile->bufpos = thefile->dataRead = 0;
+            thefile->filePtr = pos;
+        }
     }
 
     return APR_OS2_STATUS(rc);
Index: file_io/win32/seek.c
===================================================================
RCS file: /home/cvspublic/apr/file_io/win32/seek.c,v
retrieving revision 1.21
diff -u -r1.21 seek.c
--- file_io/win32/seek.c	28 Aug 2001 16:41:14 -0000	1.21
+++ file_io/win32/seek.c	12 Mar 2002 01:58:29 -0000
@@ -81,8 +81,10 @@
             rc = apr_get_os_error();
         else
             rc = APR_SUCCESS;
-        if (rc == APR_SUCCESS)
+        if (rc == APR_SUCCESS) {
             thefile->eof_hit = thefile->bufpos = thefile->dataRead = 0;
+            thefile->filePtr = pos;
+        }
     }
 
     return rc;

Running the latest version testfile before and after the patch may be
instructive.

-- 
Jeff Trawick | trawick@attglobal.net
Born in Roswell... married an alien...

Mime
View raw message