[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn_fs__dag_get_node question

From: Philip Martin <philip_at_codematters.co.uk>
Date: 2002-06-08 02:12:32 CEST

Greg Stein <gstein@lyra.org> writes:

> On Sat, Jun 08, 2002 at 12:35:10AM +0100, Philip Martin wrote:
> >...
> > There are four calls to svn_fs__dag_get_node in libsvn_fs/tree.c that
> > do not check the returned error status
> >...
> > So the question is what should happen if the calls fail. Should the
> > two functions id_check_ancestor and id_is_parent also fail? Or should
> > they succeed but set *is_ancestor and *is_parent false?
>
> Failure.
>
> If you ask for a specific ID, and it is /not/ present, then BOOM!

How about this

* svn/subversion/libsvn_fs/tree.c
  (id_check_ancestor, id_is_parent): Check for errors when getting nodes.

Index: ../svn/subversion/libsvn_fs/tree.c
===================================================================
--- ../svn/subversion/libsvn_fs/tree.c
+++ ../svn/subversion/libsvn_fs/tree.c Sat Jun 8 00:38:27 2002
@@ -1214,8 +1214,8 @@
   dag_node_t *node1, *node2;
 
   /* Get the nodes. */
- svn_fs__dag_get_node (&node1, fs, id1, trail);
- svn_fs__dag_get_node (&node2, fs, id2, trail);
+ SVN_ERR (svn_fs__dag_get_node (&node1, fs, id1, trail));
+ SVN_ERR (svn_fs__dag_get_node (&node2, fs, id2, trail));
   
   /* Do the test. If the test fails, we'll just go with "not an
      ancestor" for now. ### better come back and check this out. */
@@ -1234,8 +1234,8 @@
   dag_node_t *node1, *node2;
 
   /* Get the nodes. */
- svn_fs__dag_get_node (&node1, fs, id1, trail);
- svn_fs__dag_get_node (&node2, fs, id2, trail);
+ SVN_ERR (svn_fs__dag_get_node (&node1, fs, id1, trail));
+ SVN_ERR (svn_fs__dag_get_node (&node2, fs, id2, trail));
 
   return svn_fs__dag_is_parent (is_parent, node1, node2, trail);
 }

-- 
Philip
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Jun 8 02:13:11 2002

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.