[EMAIL PROTECTED] wrote:
> Author: bojan
> Date: Mon May 14 16:45:20 2007
> New Revision: 538019
> 
> URL: http://svn.apache.org/viewvc?view=rev&rev=538019
> Log:
> Avoid calling apr_file_flush_locked() on an unlocked file.
> 
> Modified:
>     apr/apr/trunk/file_io/unix/seek.c
> 
> Modified: apr/apr/trunk/file_io/unix/seek.c
> URL: 
> http://svn.apache.org/viewvc/apr/apr/trunk/file_io/unix/seek.c?view=diff&rev=538019&r1=538018&r2=538019
> ==============================================================================
> --- apr/apr/trunk/file_io/unix/seek.c (original)
> +++ apr/apr/trunk/file_io/unix/seek.c Mon May 14 16:45:20 2007
> @@ -101,5 +101,5 @@
>      if (ftruncate(fp->filedes, offset) == -1) {
>          return errno;
>      }
> -    return setptr(fp, offset);
> +    return apr_file_seek(fp, APR_SET, &offset);
>  }
> 
> 

Nice opportunity to document exactly what happens to the file offset.

--
Davi Arnaut
Index: include/apr_file_io.h
===================================================================
--- include/apr_file_io.h       (revision 538032)
+++ include/apr_file_io.h       (working copy)
@@ -808,6 +808,7 @@
  * Truncate the file's length to the specified offset
  * @param fp The file to truncate
  * @param offset The offset to truncate to.
+ * @remark The read/write file offset is repositioned at offset.
  */
 APR_DECLARE(apr_status_t) apr_file_trunc(apr_file_t *fp, apr_off_t offset);
 

Reply via email to