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

PATCH: Leaking errors

From: Julian Foad <julianfoad_at_btopenworld.com>
Date: 2003-12-19 18:50:17 CET

Ben Collins-Sussman wrote:
> On Thu, 2003-12-18 at 20:36, Julian Foad wrote:
>
>>How should failure of svn_fs_check_path be handled here?
>
> I don't think there's anything wrong with wrapping the serr in a
> dav_svn_convert_err(). You've got the right idea.

OK, thanks. With that in place, here's a patch to fix some more error leaks that I found by looking through the code.

Should I commit this?

- Julian

Don't leak errors; handle or clear them.

* subversion/clients/cmdline/log-cmd.c (log_message_receiver):
* subversion/libsvn_client/add.c (svn_client__get_auto_props):
* subversion/libsvn_client/copy.c (repos_to_wc_copy):
* subversion/libsvn_client/switch.c (svn_client_switch):
* subversion/libsvn_client/update.c (svn_client__update_internal):
* subversion/libsvn_fs/revs-txns.c (svn_fs_txn_proplist, svn_fs_txn_prop,
    svn_fs_change_txn_prop):
* subversion/libsvn_fs/tree.c (window_consumer):
* subversion/libsvn_ra_dav/session.c (get_server_settings):
* subversion/libsvn_repos/delta.c (delta_proplists):
* subversion/libsvn_repos/dump.c (svn_repos_dump_fs):
* subversion/libsvn_repos/load.c (new_revision_record, maybe_add_with_history,
    new_node_record, close_node, close_revision):
* subversion/libsvn_subr/io.c (svn_io_run_diff3):
* subversion/svnlook/main.c (print_diff_tree):
* subversion/svnserve/serve.c (serve):
  Handle errors with SVN_ERR.

* subversion/clients/cmdline/main.c (main):
  Handle errors with svn_handle_error.

* subversion/libsvn_client/revert.c (revert):
  Handle errors with clean-up.

* subversion/libsvn_ra_dav/fetch.c (get_file_reader):
  Clear any error that occurs, as there is no way to report it.

* subversion/libsvn_ra_svn/editorp.c (ra_svn_close_edit):
* subversion/libsvn_subr/subst.c (svn_subst_translate_cstring):
* subversion/libsvn_wc/lock.c (do_open):
* subversion/libsvn_wc/update_editor.c (apply_textdelta):
  Clear any error that occurs within error-handling code.

* subversion/libsvn_wc/log.c (svn_wc__run_log):
  Return the error - don't just leak it and continue!

* subversion/mod_dav_svn/update.c (dav_svn__update_report):
  Handle errors with dav_svn_convert_err.

* subversion/mod_dav_svn/util.c (dav_svn_get_safe_cr):
* subversion/mod_dav_svn/version.c (dav_svn__drev_report):
  Clear errors that are intentionally ignored.

* subversion/tests/libsvn_delta/svndiff-test.c (main):
* subversion/tests/libsvn_delta/vdelta-test.c (do_one_diff, main):
* subversion/tests/libsvn_diff/diff-test.c (main):
* subversion/tests/libsvn_diff/diff3-test.c (main):
* subversion/tests/libsvn_diff/diff4-test.c (main):
  Handle errors with svn_handle_error or svn_error_clear.

Index: subversion/libsvn_fs/tree.c
===================================================================
--- subversion/libsvn_fs/tree.c (revision 8041)
+++ subversion/libsvn_fs/tree.c (working copy)
@@ -3527,9 +3527,9 @@
   if ((! window) || (tb->target_string->len > SVN_FS_WRITE_BUFFER_SIZE))
     {
       apr_size_t len = tb->target_string->len;
- svn_stream_write (tb->target_stream,
- tb->target_string->data,
- &len);
+ SVN_ERR (svn_stream_write (tb->target_stream,
+ tb->target_string->data,
+ &len));
       svn_stringbuf_set (tb->target_string, "");
     }
 
Index: subversion/libsvn_fs/revs-txns.c
===================================================================
--- subversion/libsvn_fs/revs-txns.c (revision 8041)
+++ subversion/libsvn_fs/revs-txns.c (working copy)
@@ -453,7 +453,7 @@
   SVN_ERR (svn_fs__check_fs (fs));
 
   args.table_p = &table;
- svn_fs_txn_name (&args.id, txn, pool);
+ SVN_ERR (svn_fs_txn_name (&args.id, txn, pool));
   SVN_ERR (svn_fs__retry_txn (fs, txn_body_txn_proplist, &args, pool));
 
   *table_p = table ? table : apr_hash_make (pool);
@@ -475,7 +475,7 @@
 
   /* Get the proplist. */
   args.table_p = &table;
- svn_fs_txn_name (&args.id, txn, pool);
+ SVN_ERR (svn_fs_txn_name (&args.id, txn, pool));
   SVN_ERR (svn_fs__retry_txn (fs, txn_body_txn_proplist, &args, pool));
 
   /* And then the prop from that list (if there was a list). */
@@ -544,7 +544,7 @@
 
   SVN_ERR (svn_fs__check_fs (fs));
 
- svn_fs_txn_name (&args.id, txn, pool);
+ SVN_ERR (svn_fs_txn_name (&args.id, txn, pool));
   args.name = name;
   args.value = value;
   SVN_ERR (svn_fs__retry_txn (fs, txn_body_change_txn_prop, &args, pool));
Index: subversion/libsvn_wc/log.c
===================================================================
--- subversion/libsvn_wc/log.c (revision 8041)
+++ subversion/libsvn_wc/log.c (working copy)
@@ -1249,9 +1249,9 @@
 
     err = svn_io_file_read (f, buf, &buf_len, pool);
     if (err && !APR_STATUS_IS_EOF(err->apr_err))
- svn_error_createf (err->apr_err, err,
- "Error reading administrative log file in '%s'",
- svn_wc_adm_access_path (adm_access));
+ return svn_error_createf (err->apr_err, err,
+ "Error reading administrative log file in '%s'",
+ svn_wc_adm_access_path (adm_access));
 
     SVN_ERR (svn_xml_parse (parser, buf, buf_len, 0));
 
Index: subversion/libsvn_wc/update_editor.c
===================================================================
--- subversion/libsvn_wc/update_editor.c (revision 8041)
+++ subversion/libsvn_wc/update_editor.c (working copy)
@@ -1629,7 +1629,8 @@
   if (err)
     {
       if (hb->dest)
- svn_wc__close_text_base (hb->dest, fb->path, 0, handler_pool);
+ svn_error_clear (svn_wc__close_text_base (hb->dest, fb->path, 0,
+ handler_pool));
       svn_pool_destroy (handler_pool);
       return err;
     }
Index: subversion/libsvn_wc/lock.c
===================================================================
--- subversion/libsvn_wc/lock.c (revision 8041)
+++ subversion/libsvn_wc/lock.c (working copy)
@@ -436,7 +436,7 @@
               if (err->apr_err != SVN_ERR_WC_NOT_DIRECTORY)
                 {
                   /* This closes all the children in temporary hash as well */
- svn_wc_adm_close (lock);
+ svn_error_clear (svn_wc_adm_close (lock));
                   svn_pool_destroy (subpool);
                   return err;
                 }
Index: subversion/libsvn_subr/subst.c
===================================================================
--- subversion/libsvn_subr/subst.c (revision 8041)
+++ subversion/libsvn_subr/subst.c (working copy)
@@ -683,8 +683,8 @@
                                     eol_str, repair, keywords, expand);
   if (err)
     {
- svn_stream_close (src_stream);
- svn_stream_close (dst_stream);
+ svn_error_clear (svn_stream_close (src_stream));
+ svn_error_clear (svn_stream_close (dst_stream));
       return err;
     }
 
Index: subversion/libsvn_subr/io.c
===================================================================
--- subversion/libsvn_subr/io.c (revision 8041)
+++ subversion/libsvn_subr/io.c (working copy)
@@ -1451,8 +1451,9 @@
     SVN_ERR (svn_config_get_config (&config, pool));
     cfg = config ? apr_hash_get (config, SVN_CONFIG_CATEGORY_CONFIG,
                                  APR_HASH_KEY_STRING) : NULL;
- svn_config_get_bool (cfg, &has_arg, SVN_CONFIG_SECTION_HELPERS,
- SVN_CONFIG_OPTION_DIFF3_HAS_PROGRAM_ARG, TRUE);
+ SVN_ERR (svn_config_get_bool (cfg, &has_arg, SVN_CONFIG_SECTION_HELPERS,
+ SVN_CONFIG_OPTION_DIFF3_HAS_PROGRAM_ARG,
+ TRUE));
     if (has_arg)
       {
         const char *diff_cmd, *diff_utf8;
Index: subversion/libsvn_client/switch.c
===================================================================
--- subversion/libsvn_client/switch.c (revision 8041)
+++ subversion/libsvn_client/switch.c (working copy)
@@ -84,8 +84,9 @@
                   SVN_CONFIG_OPTION_DIFF3_CMD, NULL);
 
   /* See if the user wants last-commit timestamps instead of current ones. */
- svn_config_get_bool (cfg, &use_commit_times, SVN_CONFIG_SECTION_MISCELLANY,
- SVN_CONFIG_OPTION_USE_COMMIT_TIMES, FALSE);
+ SVN_ERR (svn_config_get_bool (cfg, &use_commit_times,
+ SVN_CONFIG_SECTION_MISCELLANY,
+ SVN_CONFIG_OPTION_USE_COMMIT_TIMES, FALSE));
 
   /* Sanity check. Without these, the switch is meaningless. */
   assert (path);
Index: subversion/libsvn_client/revert.c
===================================================================
--- subversion/libsvn_client/revert.c (revision 8041)
+++ subversion/libsvn_client/revert.c (working copy)
@@ -88,8 +88,11 @@
                       APR_HASH_KEY_STRING)
       : NULL;
 
- svn_config_get_bool (cfg, &use_commit_times, SVN_CONFIG_SECTION_MISCELLANY,
- SVN_CONFIG_OPTION_USE_COMMIT_TIMES, FALSE);
+ if ((err = svn_config_get_bool (cfg, &use_commit_times,
+ SVN_CONFIG_SECTION_MISCELLANY,
+ SVN_CONFIG_OPTION_USE_COMMIT_TIMES,
+ FALSE)))
+ goto out;
   }
 
   err = svn_wc_revert (path, adm_access, recursive, use_commit_times,
Index: subversion/libsvn_client/copy.c
===================================================================
--- subversion/libsvn_client/copy.c (revision 8041)
+++ subversion/libsvn_client/copy.c (working copy)
@@ -944,7 +944,7 @@
       fstream = svn_stream_from_aprfile (fp, pool);
       SVN_ERR (ra_lib->get_file
                (sess, "", src_revnum, fstream, &real_rev, &new_props, pool));
- svn_stream_close (fstream);
+ SVN_ERR (svn_stream_close (fstream));
       SVN_ERR (svn_io_file_close (fp, pool));
 
       /* If SRC_REVNUM is invalid (HEAD), then REAL_REV is now the
Index: subversion/libsvn_client/update.c
===================================================================
--- subversion/libsvn_client/update.c (revision 8041)
+++ subversion/libsvn_client/update.c (working copy)
@@ -98,8 +98,9 @@
                   SVN_CONFIG_OPTION_DIFF3_CMD, NULL);
 
   /* See if the user wants last-commit timestamps instead of current ones. */
- svn_config_get_bool (cfg, &use_commit_times, SVN_CONFIG_SECTION_MISCELLANY,
- SVN_CONFIG_OPTION_USE_COMMIT_TIMES, FALSE);
+ SVN_ERR (svn_config_get_bool (cfg, &use_commit_times,
+ SVN_CONFIG_SECTION_MISCELLANY,
+ SVN_CONFIG_OPTION_USE_COMMIT_TIMES, FALSE));
 
   /* Get the RA vtable that matches URL. */
   SVN_ERR (svn_ra_init_ra_libs (&ra_baton, pool));
Index: subversion/libsvn_client/add.c
===================================================================
--- subversion/libsvn_client/add.c (revision 8041)
+++ subversion/libsvn_client/add.c (working copy)
@@ -154,8 +154,9 @@
                         APR_HASH_KEY_STRING);
 
   /* check that auto props is enabled */
- svn_config_get_bool (cfg, &use_autoprops, SVN_CONFIG_SECTION_MISCELLANY,
- SVN_CONFIG_OPTION_ENABLE_AUTO_PROPS, FALSE);
+ SVN_ERR (svn_config_get_bool (cfg, &use_autoprops,
+ SVN_CONFIG_SECTION_MISCELLANY,
+ SVN_CONFIG_OPTION_ENABLE_AUTO_PROPS, FALSE));
   if (use_autoprops)
   {
     /* search for auto props */
Index: subversion/svnlook/main.c
===================================================================
--- subversion/svnlook/main.c (revision 8041)
+++ subversion/svnlook/main.c (working copy)
@@ -896,9 +896,9 @@
 
   /* Make sure we delete any temporary files. */
   if (orig_path)
- svn_io_remove_file (orig_path, pool);
+ SVN_ERR (svn_io_remove_file (orig_path, pool));
   if (new_path)
- svn_io_remove_file (new_path, pool);
+ SVN_ERR (svn_io_remove_file (new_path, pool));
 
   /*** Now handle property diffs ***/
   if ((node->prop_mod) && (node->action != 'D'))
Index: subversion/mod_dav_svn/update.c
===================================================================
--- subversion/mod_dav_svn/update.c (revision 8041)
+++ subversion/mod_dav_svn/update.c (working copy)
@@ -1355,7 +1355,9 @@
 
       serr = svn_fs_check_path(&dst_kind, uc.rev_root, dst_path,
                                resource->pool);
- /* ### what to do with this error? */
+ if (serr)
+ return dav_svn_convert_err(serr, HTTP_INTERNAL_SERVER_ERROR,
+ "Failed to find the kind of a path");
 
       if (dst_kind == svn_node_dir)
         {
@@ -1363,7 +1365,11 @@
              the new vsn-rsc-urls for the switched dir. this walk
              contains essentially nothing but <add> tags. */
           svn_fs_root_t *zero_root;
- svn_fs_revision_root(&zero_root, repos->fs, 0, resource->pool);
+ serr = svn_fs_revision_root(&zero_root, repos->fs, 0,
+ resource->pool);
+ if (serr)
+ return dav_svn_convert_err(serr, HTTP_INTERNAL_SERVER_ERROR,
+ "Failed to find the revision root");
 
           send_xml(&uc, "<S:resource-walk>" DEBUG_CR);
 
Index: subversion/mod_dav_svn/version.c
===================================================================
--- subversion/mod_dav_svn/version.c (revision 8041)
+++ subversion/mod_dav_svn/version.c (working copy)
@@ -815,6 +815,7 @@
   apr_time_t tm = (apr_time_t) -1;
   svn_revnum_t rev;
   apr_bucket_brigade *bb;
+ svn_error_t *err;
 
   /* Find the DAV:creationdate element and get the requested time from it. */
   ns = dav_svn_find_ns(doc->namespaces, "DAV:");
@@ -824,9 +825,10 @@
         {
           if (child->ns != ns || strcmp(child->name, "creationdate") != 0)
             continue;
- /* If this fails, we'll notice below. */
- svn_time_from_cstring(&tm, child->first_cdata.first->text,
- resource->pool);
+ /* If this fails, we'll notice below, so ignore any error for now. */
+ svn_error_clear(svn_time_from_cstring(&tm,
+ child->first_cdata.first->text,
+ resource->pool));
         }
     }
 
@@ -838,9 +840,10 @@
     }
 
   /* Do the actual work of finding the revision by date. */
- if (svn_repos_dated_revision(&rev, resource->info->repos->repos, tm,
- resource->pool) != SVN_NO_ERROR)
+ if ((err = svn_repos_dated_revision(&rev, resource->info->repos->repos, tm,
+ resource->pool)) != SVN_NO_ERROR)
     {
+ svn_error_clear (err);
       return dav_new_error(resource->pool, HTTP_INTERNAL_SERVER_ERROR, 0,
                            "Could not access revision times.");
     }
Index: subversion/mod_dav_svn/util.c
===================================================================
--- subversion/mod_dav_svn/util.c (revision 8041)
+++ subversion/mod_dav_svn/util.c (working copy)
@@ -94,18 +94,31 @@
   svn_fs_root_t *other_root;
   svn_fs_t *fs = svn_fs_root_fs(root);
   const svn_fs_id_t *id, *other_id;
+ svn_error_t *err;
 
- if (svn_fs_node_id(&id, root, path, pool))
- return revision; /* couldn't get id of root/path */
+ if ((err = svn_fs_node_id(&id, root, path, pool)))
+ {
+ svn_error_clear(err);
+ return revision; /* couldn't get id of root/path */
+ }
 
- if (get_last_history_rev(&history_rev, root, path, pool))
- return revision; /* couldn't find last history rev */
+ if ((err = get_last_history_rev(&history_rev, root, path, pool)))
+ {
+ svn_error_clear(err);
+ return revision; /* couldn't find last history rev */
+ }
   
- if (svn_fs_revision_root(&other_root, fs, history_rev, pool))
- return revision; /* couldn't open the history rev */
+ if ((err = svn_fs_revision_root(&other_root, fs, history_rev, pool)))
+ {
+ svn_error_clear(err);
+ return revision; /* couldn't open the history rev */
+ }
 
- if (svn_fs_node_id(&other_id, other_root, path, pool))
- return revision; /* couldn't get id of other_root/path */
+ if ((err = svn_fs_node_id(&other_id, other_root, path, pool)))
+ {
+ svn_error_clear(err);
+ return revision; /* couldn't get id of other_root/path */
+ }
 
   if (svn_fs_compare_ids(id, other_id) == 0)
     return history_rev; /* the history rev is safe! the same node
Index: subversion/clients/cmdline/log-cmd.c
===================================================================
--- subversion/clients/cmdline/log-cmd.c (revision 8041)
+++ subversion/clients/cmdline/log-cmd.c (working copy)
@@ -235,7 +235,7 @@
       {
         /* Convert log message from UTF8/LF to native locale and eol-style. */
         svn_string_t *logmsg = svn_string_create (msg, pool);
- svn_subst_detranslate_string (&logmsg, logmsg, TRUE, pool);
+ SVN_ERR (svn_subst_detranslate_string (&logmsg, logmsg, TRUE, pool));
         msg_stdout = logmsg->data;
       }
     }
Index: subversion/clients/cmdline/main.c
===================================================================
--- subversion/clients/cmdline/main.c (revision 8041)
+++ subversion/clients/cmdline/main.c (working copy)
@@ -1218,10 +1218,11 @@
     /* There are two different ways the user can disable disk caching
        of credentials: either via --no-auth-cache, or in the config
        file ('store-auth-creds = no'). */
- svn_config_get_bool (cfg, &store_password_val,
- SVN_CONFIG_SECTION_AUTH,
- SVN_CONFIG_OPTION_STORE_AUTH_CREDS,
- TRUE);
+ if ((err = svn_config_get_bool (cfg, &store_password_val,
+ SVN_CONFIG_SECTION_AUTH,
+ SVN_CONFIG_OPTION_STORE_AUTH_CREDS,
+ TRUE)))
+ svn_handle_error (err, stderr, TRUE);
     if (opt_state.no_auth_cache || !store_password_val)
       svn_auth_set_parameter(ab, SVN_AUTH_PARAM_NO_AUTH_CACHE,
                              (void *) "");
Index: subversion/tests/libsvn_diff/diff-test.c
===================================================================
--- subversion/tests/libsvn_diff/diff-test.c (revision 8041)
+++ subversion/tests/libsvn_diff/diff-test.c (working copy)
@@ -50,16 +50,20 @@
   apr_pool_t *pool;
   svn_stream_t *ostream;
   int rc;
+ svn_error_t *svn_err;
 
   apr_initialize();
 
   pool = svn_pool_create(NULL);
 
- svn_stream_for_stdout(&ostream, pool);
-
- if (argc == 3)
+ svn_err = svn_stream_for_stdout(&ostream, pool);
+ if (svn_err)
+ {
+ svn_handle_error(svn_err, stdout, FALSE);
+ rc = 2;
+ }
+ else if (argc == 3)
     {
- svn_error_t *svn_err;
       svn_boolean_t has_changes;
 
       svn_err = do_diff(ostream, argv[1], argv[2], &has_changes, pool);
@@ -75,8 +79,9 @@
     }
   else
     {
- svn_stream_printf(ostream, pool,
- "Usage: %s <file1> <file2>\n", argv[0]);
+ svn_error_clear(svn_stream_printf(ostream, pool,
+ "Usage: %s <file1> <file2>\n",
+ argv[0]));
       rc = 2;
     }
 
Index: subversion/tests/libsvn_diff/diff3-test.c
===================================================================
--- subversion/tests/libsvn_diff/diff3-test.c (revision 8041)
+++ subversion/tests/libsvn_diff/diff3-test.c (working copy)
@@ -53,17 +53,21 @@
   apr_pool_t *pool;
   svn_stream_t *ostream;
   int rc;
+ svn_error_t *svn_err;
 
   apr_initialize();
 
   pool = svn_pool_create(NULL);
 
- svn_stream_for_stdout(&ostream, pool);
-
- if (argc == 4)
+ svn_err = svn_stream_for_stdout(&ostream, pool);
+ if (svn_err)
+ {
+ svn_handle_error(svn_err, stdout, FALSE);
+ rc = 2;
+ }
+ else if (argc == 4)
     {
       svn_boolean_t has_changes;
- svn_error_t *svn_err;
 
       svn_err = do_diff3(ostream, argv[2], argv[1], argv[3], &has_changes, pool);
       if (svn_err == NULL)
@@ -78,8 +82,9 @@
     }
   else
     {
- svn_stream_printf(ostream, pool,
- "Usage: %s <mine> <older> <yours>\n", argv[0]);
+ svn_error_clear(svn_stream_printf(ostream, pool,
+ "Usage: %s <mine> <older> <yours>\n",
+ argv[0]));
       rc = 2;
     }
 
Index: subversion/tests/libsvn_diff/diff4-test.c
===================================================================
--- subversion/tests/libsvn_diff/diff4-test.c (revision 8041)
+++ subversion/tests/libsvn_diff/diff4-test.c (working copy)
@@ -54,17 +54,20 @@
   apr_pool_t *pool;
   svn_stream_t *ostream;
   int rc = 0;
+ svn_error_t *svn_err;
 
   apr_initialize();
 
   pool = svn_pool_create(NULL);
 
- svn_stream_for_stdout(&ostream, pool);
-
- if (argc == 5)
+ svn_err = svn_stream_for_stdout(&ostream, pool);
+ if (svn_err)
+ {
+ svn_handle_error(svn_err, stdout, FALSE);
+ rc = 2;
+ }
+ else if (argc == 5)
     {
- svn_error_t *svn_err;
-
       svn_err = do_diff4(ostream,
                          argv[2], argv[1], argv[3], argv[4],
                          pool);
@@ -76,8 +79,9 @@
     }
   else
     {
- svn_stream_printf(ostream, pool,
- "Usage: %s <mine> <older> <yours> <ancestor>\n", argv[0]);
+ svn_error_clear(svn_stream_printf
+ (ostream, pool, "Usage: %s <mine> <older> <yours> <ancestor>\n",
+ argv[0]));
       rc = 2;
     }
 
Index: subversion/tests/libsvn_delta/svndiff-test.c
===================================================================
--- subversion/tests/libsvn_delta/svndiff-test.c (revision 8041)
+++ subversion/tests/libsvn_delta/svndiff-test.c (working copy)
@@ -78,10 +78,12 @@
   encoder = svn_base64_encode (stdout_stream, pool);
 #endif
   svn_txdelta_to_svndiff (encoder, pool, &svndiff_handler, &svndiff_baton);
- svn_txdelta_send_txstream (txdelta_stream,
- svndiff_handler,
- svndiff_baton,
- pool);
+ err = svn_txdelta_send_txstream (txdelta_stream,
+ svndiff_handler,
+ svndiff_baton,
+ pool);
+ if (err)
+ svn_handle_error (err, stdout, TRUE);
 
   apr_file_close (source_file);
   apr_file_close (target_file);
Index: subversion/tests/libsvn_delta/vdelta-test.c
===================================================================
--- subversion/tests/libsvn_delta/vdelta-test.c (revision 8041)
+++ subversion/tests/libsvn_delta/vdelta-test.c (working copy)
@@ -57,7 +57,10 @@
                svn_stream_from_aprfile (target_file, fpool),
                fpool);
   do {
- svn_txdelta_next_window (&delta_window, delta_stream, wpool);
+ svn_error_t *err;
+ err = svn_txdelta_next_window (&delta_window, delta_stream, wpool);
+ if (err)
+ svn_handle_error (err, stderr, TRUE);
     if (delta_window != NULL)
       {
         *len += print_delta_window (delta_window, tag, quiet, stream);
@@ -183,8 +186,14 @@
       for (count_AB = 0; count_AB < count_B; ++count_AB)
         {
           svn_txdelta__compose_ctx_t context = { 0 };
- svn_txdelta_next_window (&window_A, stream_A, wpool);
- svn_txdelta_next_window (&window_B, stream_B, wpool);
+ svn_error_t *err;
+
+ err = svn_txdelta_next_window (&window_A, stream_A, wpool);
+ if (err)
+ svn_handle_error (err, stderr, TRUE);
+ err = svn_txdelta_next_window (&window_B, stream_B, wpool);
+ if (err)
+ svn_handle_error (err, stderr, TRUE);
 
           /* Note: It's not possible that window_B is null, we already
              counted the number of windows in the second delta. */
Index: subversion/libsvn_repos/load.c
===================================================================
--- subversion/libsvn_repos/load.c (revision 8041)
+++ subversion/libsvn_repos/load.c (working copy)
@@ -674,10 +674,10 @@
       SVN_ERR (svn_fs_txn_root (&(rb->txn_root), rb->txn, pool));
       
       if (pb->outstream)
- svn_stream_printf (pb->outstream, pool,
- "<<< Started new transaction, based on "
- "original revision %"
- SVN_REVNUM_T_FMT "\n", rb->rev);
+ SVN_ERR (svn_stream_printf (pb->outstream, pool,
+ "<<< Started new transaction, based on "
+ "original revision %"
+ SVN_REVNUM_T_FMT "\n", rb->rev));
     }
 
   /* If we're parsing revision 0, only the revision are (possibly)
@@ -727,7 +727,7 @@
       if (pb->outstream)
         {
           apr_size_t len = 9;
- svn_stream_write (pb->outstream, "COPIED...", &len);
+ SVN_ERR (svn_stream_write (pb->outstream, "COPIED...", &len));
         }
     }
 
@@ -771,23 +771,26 @@
     case svn_node_action_change:
       {
         if (pb->outstream)
- svn_stream_printf (pb->outstream, pool,
- " * editing path : %s ...", nb->path);
+ SVN_ERR (svn_stream_printf (pb->outstream, pool,
+ " * editing path : %s ...",
+ nb->path));
         break;
       }
     case svn_node_action_delete:
       {
         if (pb->outstream)
- svn_stream_printf (pb->outstream, pool,
- " * deleting path : %s ...", nb->path);
+ SVN_ERR (svn_stream_printf (pb->outstream, pool,
+ " * deleting path : %s ...",
+ nb->path));
         SVN_ERR (svn_fs_delete (rb->txn_root, nb->path, pool));
         break;
       }
     case svn_node_action_add:
       {
         if (pb->outstream)
- svn_stream_printf (pb->outstream, pool,
- " * adding path : %s ...", nb->path);
+ SVN_ERR (svn_stream_printf (pb->outstream, pool,
+ " * adding path : %s ...",
+ nb->path));
 
         SVN_ERR (maybe_add_with_history (nb, rb, pool));
         break;
@@ -795,8 +798,9 @@
     case svn_node_action_replace:
       {
         if (pb->outstream)
- svn_stream_printf (pb->outstream, pool,
- " * replacing path : %s ...", nb->path);
+ SVN_ERR (svn_stream_printf (pb->outstream, pool,
+ " * replacing path : %s ...",
+ nb->path));
 
         SVN_ERR (svn_fs_delete (rb->txn_root, nb->path, pool));
 
@@ -914,7 +918,7 @@
   if (pb->outstream)
     {
       apr_size_t len = 7;
- svn_stream_write (pb->outstream, " done.\n", &len);
+ SVN_ERR (svn_stream_write (pb->outstream, " done.\n", &len));
     }
   
   return SVN_NO_ERROR;
@@ -959,16 +963,19 @@
     {
       if (new_rev == rb->rev)
         {
- svn_stream_printf (pb->outstream, rb->pool,
- "\n------- Committed revision %" SVN_REVNUM_T_FMT
- " >>>\n\n", new_rev);
+ SVN_ERR (svn_stream_printf (pb->outstream, rb->pool,
+ "\n------- Committed revision %"
+ SVN_REVNUM_T_FMT
+ " >>>\n\n", new_rev));
         }
       else
         {
- svn_stream_printf (pb->outstream, rb->pool,
- "\n------- Committed new rev %" SVN_REVNUM_T_FMT
- " (loaded from original rev %" SVN_REVNUM_T_FMT
- ") >>>\n\n", new_rev, rb->rev);
+ SVN_ERR (svn_stream_printf (pb->outstream, rb->pool,
+ "\n------- Committed new rev %"
+ SVN_REVNUM_T_FMT
+ " (loaded from original rev %"
+ SVN_REVNUM_T_FMT
+ ") >>>\n\n", new_rev, rb->rev));
         }
     }
 
Index: subversion/libsvn_repos/dump.c
===================================================================
--- subversion/libsvn_repos/dump.c (revision 8041)
+++ subversion/libsvn_repos/dump.c (working copy)
@@ -976,9 +976,9 @@
       /* Reuse all memory consumed by the dump of this one revision. */
       svn_pool_clear (subpool);
       if (feedback_stream)
- svn_stream_printf (feedback_stream, pool,
- "* %s revision %" SVN_REVNUM_T_FMT ".\n",
- stream ? "Dumped" : "Verified", to_rev);
+ SVN_ERR (svn_stream_printf (feedback_stream, pool,
+ "* %s revision %" SVN_REVNUM_T_FMT ".\n",
+ stream ? "Dumped" : "Verified", to_rev));
     }
 
   svn_pool_destroy (subpool);
Index: subversion/libsvn_repos/delta.c
===================================================================
--- subversion/libsvn_repos/delta.c (revision 8041)
+++ subversion/libsvn_repos/delta.c (working copy)
@@ -531,8 +531,8 @@
       svn_string_t *last_author = NULL;
       
       /* Get the CR and two derivative props. ### check for error returns. */
- svn_fs_node_created_rev (&committed_rev, c->target_root,
- target_path, subpool);
+ SVN_ERR (svn_fs_node_created_rev (&committed_rev, c->target_root,
+ target_path, subpool));
       if (SVN_IS_VALID_REVNUM (committed_rev))
         {
           svn_fs_t *fs = svn_fs_root_fs (c->target_root);
@@ -545,8 +545,8 @@
                               cr_str, subpool));
 
           /* Transmit the committed-date. */
- svn_fs_revision_prop (&committed_date, fs, committed_rev,
- SVN_PROP_REVISION_DATE, subpool);
+ SVN_ERR (svn_fs_revision_prop (&committed_date, fs, committed_rev,
+ SVN_PROP_REVISION_DATE, subpool));
           if (committed_date || source_path)
             {
               SVN_ERR (change_fn (c, object, SVN_PROP_ENTRY_COMMITTED_DATE,
@@ -554,8 +554,8 @@
             }
 
           /* Transmit the last-author. */
- svn_fs_revision_prop (&last_author, fs, committed_rev,
- SVN_PROP_REVISION_AUTHOR, subpool);
+ SVN_ERR (svn_fs_revision_prop (&last_author, fs, committed_rev,
+ SVN_PROP_REVISION_AUTHOR, subpool));
           if (last_author || source_path)
             {
               SVN_ERR (change_fn (c, object, SVN_PROP_ENTRY_LAST_AUTHOR,
@@ -563,7 +563,7 @@
             }
 
           /* Transmit the UUID. */
- svn_fs_get_uuid (fs, &uuid, subpool);
+ SVN_ERR (svn_fs_get_uuid (fs, &uuid, subpool));
           if (uuid || source_path)
             {
               SVN_ERR (change_fn (c, object, SVN_PROP_ENTRY_UUID,
Index: subversion/libsvn_ra_svn/editorp.c
===================================================================
--- subversion/libsvn_ra_svn/editorp.c (revision 8041)
+++ subversion/libsvn_ra_svn/editorp.c (working copy)
@@ -323,7 +323,7 @@
   err = svn_ra_svn_read_cmd_response(eb->conn, pool, "");
   if (err)
     {
- svn_ra_svn_write_cmd(eb->conn, pool, "abort-edit", "");
+ svn_error_clear(svn_ra_svn_write_cmd(eb->conn, pool, "abort-edit", ""));
       return err;
     }
   if (eb->callback)
Index: subversion/libsvn_ra_dav/session.c
===================================================================
--- subversion/libsvn_ra_dav/session.c (revision 8041)
+++ subversion/libsvn_ra_dav/session.c (working copy)
@@ -382,8 +382,8 @@
                      SVN_CONFIG_OPTION_HTTP_PROXY_PASSWORD, NULL);
       svn_config_get(cfg, &timeout_str, SVN_CONFIG_SECTION_GLOBAL,
                      SVN_CONFIG_OPTION_HTTP_TIMEOUT, NULL);
- svn_config_get_bool(cfg, compression, SVN_CONFIG_SECTION_GLOBAL,
- SVN_CONFIG_OPTION_HTTP_COMPRESSION, FALSE);
+ SVN_ERR(svn_config_get_bool(cfg, compression, SVN_CONFIG_SECTION_GLOBAL,
+ SVN_CONFIG_OPTION_HTTP_COMPRESSION, FALSE));
       svn_config_get(cfg, &debug_str, SVN_CONFIG_SECTION_GLOBAL,
                      SVN_CONFIG_OPTION_NEON_DEBUG_MASK, NULL);
     }
@@ -406,8 +406,9 @@
                      SVN_CONFIG_OPTION_HTTP_PROXY_PASSWORD, *proxy_password);
       svn_config_get(cfg, &timeout_str, server_group,
                      SVN_CONFIG_OPTION_HTTP_TIMEOUT, timeout_str);
- svn_config_get_bool(cfg, compression, server_group,
- SVN_CONFIG_OPTION_HTTP_COMPRESSION, *compression);
+ SVN_ERR(svn_config_get_bool(cfg, compression, server_group,
+ SVN_CONFIG_OPTION_HTTP_COMPRESSION,
+ *compression));
       svn_config_get(cfg, &debug_str, server_group,
                      SVN_CONFIG_OPTION_NEON_DEBUG_MASK, debug_str);
     }
Index: subversion/libsvn_ra_dav/fetch.c
===================================================================
--- subversion/libsvn_ra_dav/fetch.c (revision 8041)
+++ subversion/libsvn_ra_dav/fetch.c (working copy)
@@ -619,12 +619,13 @@
 
   /* Write however many bytes were passed in by neon. */
   wlen = len;
- svn_stream_write(stream, buf, &wlen);
+ svn_error_clear(svn_stream_write(stream, buf, &wlen));
 
 #if 0
   /* Neon's callback won't let us return error. Joe knows this is a
      bug in his API, so this section can be reactivated someday. */
 
+ SVN_ERR(svn_stream_write(stream, buf, &wlen));
   if (wlen != len)
     {
       /* Uh oh, didn't write as many bytes as neon gave us. */
Index: subversion/svnserve/serve.c
===================================================================
--- subversion/svnserve/serve.c (revision 8041)
+++ subversion/svnserve/serve.c (working copy)
@@ -1125,7 +1125,7 @@
     return SVN_NO_ERROR;
 
   SVN_ERR(svn_fs_get_uuid(b.fs, &uuid, pool));
- svn_ra_svn_write_cmd_response(conn, pool, "cc", uuid, b.repos_url);
+ SVN_ERR(svn_ra_svn_write_cmd_response(conn, pool, "cc", uuid, b.repos_url));
 
   return svn_ra_svn_handle_commands(conn, pool, main_commands, &b);
 }

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Dec 19 18:49:55 2003

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.