]> granicus.if.org Git - apache/commitdiff
* modules/dav/fs/repos.c (dav_fs_copymove_file): Update for the fact
authorJoe Orton <jorton@apache.org>
Thu, 11 Mar 2004 14:32:00 +0000 (14:32 +0000)
committerJoe Orton <jorton@apache.org>
Thu, 11 Mar 2004 14:32:00 +0000 (14:32 +0000)
that apr_file_read() has guaranteed len == 0 at EOF for a looong time;
and avoid a redundant call to write(,,0) when EOF is reached.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102934 13f79535-47bb-0310-9956-ffa450edef68

modules/dav/fs/repos.c

index ba57c4d723d259155b06b1cd53fb39778a7fd300..487fab60658a71489a7e149b69f75630c5a94727 100644 (file)
@@ -348,7 +348,10 @@ static dav_error * dav_fs_copymove_file(
                                  "Could not read input file");
         }
 
-        /* write any bytes that were read (applies to APR_EOF, too) */
+        if (status == APR_EOF)
+            break;
+
+        /* write any bytes that were read */
         if (apr_file_write_full(outf, pbuf->buf, len, NULL) != APR_SUCCESS) {
             int save_errno = errno;
 
@@ -375,9 +378,6 @@ static dav_error * dav_fs_copymove_file(
             return dav_new_error(p, HTTP_INTERNAL_SERVER_ERROR, 0,
                                  "Could not write output file");
         }
-
-        if (status == APR_EOF)
-            break;
     }
 
     apr_file_close(inf);