FreeBSD/contrib/subversion/subversion/libsvn_fs_fs/transaction.c
/* Callback used in the implementation of unlock_proto_rev(). */
Callback used in the implementation of unlock_proto_rev().
Callback used in the implementation of unlock_proto_rev () .
static svn_error_t *
unlock_proto_rev_body(svn_fs_t *fs, const void *baton, apr_pool_t *pool)
{
  const struct unlock_proto_rev_baton *b = baton;
  apr_file_t *lockfile = b->lockcookie;
  fs_fs_shared_txn_data_t *txn = get_shared_txn(fs, &b->txn_id, FALSE);
  apr_status_t apr_err;
  if (!txn)
    return svn_error_createf(SVN_ERR_FS_CORRUPT, NULL,
                             _("Can't unlock unknown transaction '%s'"),
                             svn_fs_fs__id_txn_unparse(&b->txn_id, pool));
  if (!txn->being_written)
    return svn_error_createf(SVN_ERR_FS_CORRUPT, NULL,
                             _("Can't unlock nonlocked transaction '%s'"),
                             svn_fs_fs__id_txn_unparse(&b->txn_id, pool));
  apr_err = apr_file_unlock(lockfile);
  if (apr_err)
    return svn_error_wrap_apr
      (apr_err,
       _("Can't unlock prototype revision lockfile for transaction '%s'"),
       svn_fs_fs__id_txn_unparse(&b->txn_id, pool));
  apr_err = apr_file_close(lockfile);
  if (apr_err)
    return svn_error_wrap_apr
      (apr_err,
       _("Can't close prototype revision lockfile for transaction '%s'"),
       svn_fs_fs__id_txn_unparse(&b->txn_id, pool));
  txn->being_written = FALSE;
  return SVN_NO_ERROR;
}
static svn_error_t * unlock_proto_rev_body ( svn_fs_t * fs , const void * baton , apr_pool_t * pool ) { const struct unlock_proto_rev_baton * b = baton ; apr_file_t * lockfile = b -> lockcookie ; fs_fs_shared_txn_data_t * txn = get_shared_txn ( fs , & b -> txn_id , FALSE ) ; apr_status_t apr_err ; if ( ! txn ) return svn_error_createf ( SVN_ERR_FS_CORRUPT , NULL , _ ( " " ) , svn_fs_fs__id_txn_unparse ( & b -> txn_id , pool ) ) ; if ( ! txn -> being_written ) return svn_error_createf ( SVN_ERR_FS_CORRUPT , NULL , _ ( " " ) , svn_fs_fs__id_txn_unparse ( & b -> txn_id , pool ) ) ; apr_err = apr_file_unlock ( lockfile ) ; if ( apr_err ) return svn_error_wrap_apr ( apr_err , _ ( " " ) , svn_fs_fs__id_txn_unparse ( & b -> txn_id , pool ) ) ; apr_err = apr_file_close ( lockfile ) ; if ( apr_err ) return svn_error_wrap_apr ( apr_err , _ ( " " ) , svn_fs_fs__id_txn_unparse ( & b -> txn_id , pool ) ) ; txn -> being_written = FALSE ; return SVN_NO_ERROR ; }
Callback used in the implementation of unlock_proto_rev().
Callback used in the implementation of unlock_proto_rev () .