FreeBSD/contrib/subversion/subversion/libsvn_fs_x/revprops.c
/* Make sure the revprop_generation member in FS is set.  If READ_ONLY is
 * set, open the file w/o write permission if the file is not open yet.
 * The file is kept open if it has sufficient rights (or more) but will be
 * closed and re-opened if it provided insufficient access rights.
 *
 * Call only for repos that support revprop caching.
 */
Make sure the revprop_generation member in FS is set.  If READ_ONLY is
set, open the file w/o write permission if the file is not open yet.
The file is kept open if it has sufficient rights (or more) but will be
closed and re-opened if it provided insufficient access rights.

Call only for repos that support revprop caching.
Make sure the revprop_generation member in FS is set . If READ_ONLY is set open the file w / o write permission if the file is not open yet . The file is kept open if it has sufficient rights ( or more ) but will be closed and re - opened if it provided insufficient access rights . Call only for repos that support revprop caching .
static svn_error_t *
open_revprop_generation_file(svn_fs_t *fs,
                             svn_boolean_t read_only,
                             apr_pool_t *scratch_pool)
{
  svn_fs_x__data_t *ffd = fs->fsap_data;
  apr_int32_t flags = read_only ? APR_READ : (APR_READ | APR_WRITE);
  if (   ffd->revprop_generation_file
      && (apr_file_flags_get(ffd->revprop_generation_file) & flags) != flags)
    SVN_ERR(close_revprop_generation_file(fs, scratch_pool));
  if (ffd->revprop_generation_file == NULL)
    {
      const char *path = svn_fs_x__path_revprop_generation(fs, scratch_pool);
      SVN_ERR(svn_io_file_open(&ffd->revprop_generation_file, path,
                               flags, APR_OS_DEFAULT, fs->pool));
    }
  return SVN_NO_ERROR;
}
static svn_error_t * open_revprop_generation_file ( svn_fs_t * fs , svn_boolean_t read_only , apr_pool_t * scratch_pool ) { svn_fs_x__data_t * ffd = fs -> fsap_data ; apr_int32_t flags = read_only ? APR_READ : ( APR_READ | APR_WRITE ) ; if ( ffd -> revprop_generation_file && ( apr_file_flags_get ( ffd -> revprop_generation_file ) & flags ) != flags ) SVN_ERR ( close_revprop_generation_file ( fs , scratch_pool ) ) ; if ( ffd -> revprop_generation_file == NULL ) { const char * path = svn_fs_x__path_revprop_generation ( fs , scratch_pool ) ; SVN_ERR ( svn_io_file_open ( & ffd -> revprop_generation_file , path , flags , APR_OS_DEFAULT , fs -> pool ) ) ; } return SVN_NO_ERROR ; }
Make sure the revprop_generation member in FS is set.
Make sure the revprop_generation member in FS is set .
/* Close the current file handle if it has insufficient rights. */ /* If not open already, open with sufficient rights. */