FreeBSD/contrib/subversion/subversion/libsvn_fs_fs/transaction.c
/* Something went wrong and the pool for the rep write is being
   cleared before we've finished writing the rep.  So we need
   to remove the rep from the protorevfile and we need to unlock
   the protorevfile. */
Something went wrong and the pool for the rep write is being
cleared before we've finished writing the rep.  So we need
to remove the rep from the protorevfile and we need to unlock
the protorevfile.
Something went wrong and the pool for the rep write is being cleared before we ' ve finished writing the rep . So we need to remove the rep from the protorevfile and we need to unlock the protorevfile .
static apr_status_t
rep_write_cleanup(void *data)
{
  struct rep_write_baton *b = data;
  svn_error_t *err;
  err = svn_io_file_trunc(b->file, b->rep_offset, b->scratch_pool);
  err = svn_error_compose_create(err, svn_io_file_close(b->file,
                                                        b->scratch_pool));
  err = svn_error_compose_create(err,
                                 unlock_proto_rev(b->fs,
                                     svn_fs_fs__id_txn_id(b->noderev->id),
                                     b->lockcookie, b->scratch_pool));
  if (err)
    {
      apr_status_t rc = err->apr_err;
      svn_error_clear(err);
      return rc;
    }
  return APR_SUCCESS;
}
static apr_status_t rep_write_cleanup ( void * data ) { struct rep_write_baton * b = data ; svn_error_t * err ; err = svn_io_file_trunc ( b -> file , b -> rep_offset , b -> scratch_pool ) ; err = svn_error_compose_create ( err , svn_io_file_close ( b -> file , b -> scratch_pool ) ) ; err = svn_error_compose_create ( err , unlock_proto_rev ( b -> fs , svn_fs_fs__id_txn_id ( b -> noderev -> id ) , b -> lockcookie , b -> scratch_pool ) ) ; if ( err ) { apr_status_t rc = err -> apr_err ; svn_error_clear ( err ) ; return rc ; } return APR_SUCCESS ; }
Something went wrong and the pool for the rep write is being
cleared before we've finished writing the rep.
Something went wrong and the pool for the rep write is being cleared before we ' ve finished writing the rep .
/* Truncate and close the protorevfile. */ /* Remove our lock regardless of any preceding errors so that the
     being_written flag is always removed and stays consistent with the
     file lock which will be removed no matter what since the pool is
     going away. */