You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2015/05/20 13:26:59 UTC

svn commit: r1680525 - /subversion/branches/fsx-1.10/subversion/libsvn_fs_x/revprops.c

Author: stefan2
Date: Wed May 20 11:26:58 2015
New Revision: 1680525

URL: http://svn.apache.org/r1680525
Log:
On the fsx-1.10 branch:
Eliminate a few OS file API calls from the FSX revprop caching code.

* subversion/libsvn_fs_x/revprops.c
  (read_revprop_generation_file): Use a single, plain read for the
                                  generation file contents.  We know
                                  that under "non-broken" circumstances
                                  we can read the whole file at once.
                                  Content checksums etc. kick in when
                                  this is not the case.

Modified:
    subversion/branches/fsx-1.10/subversion/libsvn_fs_x/revprops.c

Modified: subversion/branches/fsx-1.10/subversion/libsvn_fs_x/revprops.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsx-1.10/subversion/libsvn_fs_x/revprops.c?rev=1680525&r1=1680524&r2=1680525&view=diff
==============================================================================
--- subversion/branches/fsx-1.10/subversion/libsvn_fs_x/revprops.c (original)
+++ subversion/branches/fsx-1.10/subversion/libsvn_fs_x/revprops.c Wed May 20 11:26:58 2015
@@ -229,8 +229,14 @@ read_revprop_generation_file(apr_int64_t
                               iterpool));
 
       len = sizeof(buf);
-      SVN_ERR(svn_io_read_length_line(ffd->revprop_generation_file, buf, &len,
-                                      iterpool));
+      SVN_ERR(svn_io_file_read(ffd->revprop_generation_file, buf, &len,
+                               iterpool));
+      /* Properly terminate the string we just read.  Valid contents ends
+         with a '\n'.  Empty the buffer in all other cases. */
+      if (len > 0 && buf[len-1] == '\n')
+        buf[--len] = '\0';
+      else
+        buf[0] = '\0';
 
       /* Some data has been read.  It will most likely be complete and
        * consistent.  Extract and verify anyway. */