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

PATCH: Re: r8616: Improved warnings from svnlook and svnadmin

From: Julian Foad <julianfoad_at_btopenworld.com>
Date: 2004-02-21 15:33:26 CET

Julian Foad wrote:
>
> 1. The wrapper error is not cleared, so it leaks memory. The (only
[...]
> 2. I don't see the point of adding the words "The filesystem warning
> function was called" to whatever error occurs. Information about which

The attached patch fixes the leak, removes the words that I consider to be redundant, and documents the
responsibility of clearing the error.

OK to commit this?

- Julian

Follow-up to r8616: improved warnings from svnlook and svnadmin.

The wrapper error was not cleared, thus leaking memory, and was not really
providing useful information, so get rid of it. Improve the documentation.

* subversion/include/svn_fs.h
  (svn_fs_warning_callback_t): Document that the caller clears the error.
  Fix typos in comments.

* subversion/svnadmin/main.c (warning_func)
* subversion/svnlook/main.c (warning_func)
  Do not wrap the given error.

Index: subversion/include/svn_fs.h
===================================================================
--- subversion/include/svn_fs.h (revision 8803)
+++ subversion/include/svn_fs.h (working copy)
@@ -70,14 +70,17 @@ svn_fs_t *svn_fs_new (apr_hash_t *fs_con
 
 /** The type of a warning callback function. @a baton is the value specified
  * in the call to @c svn_fs_set_warning_func; the filesystem passes it through
- * to the callback. @a msg contains the warning message.
+ * to the callback. @a err contains the warning message.
+ *
+ * The callback function should not clear the error that is passed to it;
+ * its caller should do that.
  */
 typedef void (*svn_fs_warning_callback_t) (void *baton, svn_error_t *err);
 
 
 /** Provide a callback function, @a warning, that @a fs should use to
  * report (non-fatal) errors. To print an error, the filesystem will call
- * @a warning, passing it @a baton and the error.
+ * @a warning, passing it @a warning_baton and the error.
  *
  * By default, this is set to a function that will crash the process.
  * Dumping to @c stderr or <tt>/dev/tty</tt> is not acceptable default
Index: subversion/svnadmin/main.c
===================================================================
--- subversion/svnadmin/main.c (revision 8803)
+++ subversion/svnadmin/main.c (working copy)
@@ -115,8 +115,6 @@ warning_func (void *baton,
 {
   if (! err)
     return;
- err = svn_error_quick_wrap
- (err, "The filesystem warning function was called");
   svn_handle_error (err, stderr, FALSE);
 }
 
Index: subversion/svnlook/main.c
===================================================================
--- subversion/svnlook/main.c (revision 8803)
+++ subversion/svnlook/main.c (working copy)
@@ -1535,8 +1535,6 @@ warning_func (void *baton,
 {
   if (! err)
     return;
- err = svn_error_quick_wrap
- (err, "The filesystem warning function was called");
   svn_handle_error (err, stderr, FALSE);
 }
 

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Feb 21 15:28:28 2004

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.