On Mon, Nov 11, 2002 at 06:01:32PM -0600, philip@tigris.org wrote:
>...
> +++ trunk/subversion/libsvn_wc/diff.c Mon Nov 11 18:01:28 2002
>...
> @@ -990,7 +994,9 @@
> /* also notice we're ignoring error here; there's a chance that
> this path might not exist in the working copy, in which case
> the baseprops remains an empty hash. */
> - svn_wc_prop_list (&(b->baseprops), b->path, b->pool);
> + svn_error_t *err = svn_wc_prop_list (&(b->baseprops), b->path, b->pool);
> + if (err)
> + svn_error_clear (err);
Greg Hudson defined svn_error_clear() to accept a NULL pointer so that you
could (more simply) write:
svn_error_clear (svn_wc_prop_list (...));
>...
> +++ trunk/subversion/libsvn_wc/adm_ops.c Mon Nov 11 18:01:28 2002
> @@ -211,6 +211,7 @@
> {
> /* PATH must be some sort of file */
> const char *tmp_text_base;
> + svn_error_t *err;
>
> /* We know that the new text base is sitting in the adm tmp area
> by now, because the commit succeeded. */
> @@ -226,7 +227,9 @@
> unexpected and hard-to-maintain dependencies. Ick.
>
> So instead we just do the checksum from scratch. Ick. */
> - svn_io_file_checksum (&checksum, tmp_text_base, pool);
> + err = svn_io_file_checksum (&checksum, tmp_text_base, pool);
> + if (err)
> + svn_error_clear (err);
Especially here so that you don't have to add the new "err" declaration.
>...
> +++ trunk/subversion/libsvn_ra_local/split_url.c Mon Nov 11 18:01:29 2002
> @@ -29,7 +29,7 @@
> const char *URL,
> apr_pool_t *pool)
> {
> - svn_error_t *err;
> + svn_error_t *err = SVN_NO_ERROR;
> const char *candidate_url;
> const char *hostname, *path;
>
> @@ -134,6 +134,8 @@
> hacked this path down to a bare nub yet, so we'll chop off
> the last component of this path. */
> candidate_url = svn_path_remove_component_nts (candidate_url, pool);
> + if (err)
> + svn_error_clear (err);
> }
Woah! I think you want to reset err to NULL here. You don't want the
follow-on stuff to refer to the error any more.
Might be nice to keep some of those errors out of variables, and just get
them passed straight into _clear() to reduce any tendency to refer to them
after they get cleared.
The bitch of the problem is that valgrind isn't going to find problems with
this code, unless you can get those errors raised.
Cheers,
-g
--
Greg Stein, http://www.lyra.org/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Nov 12 05:46:28 2002