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

[PATCH] match svnauthz-validate exit code to --help promise

From: Daniel Shahaf <d.s_at_daniel.shahaf.name>
Date: Tue, 9 Oct 2012 20:29:48 +0200

svnauthz-validate --help promises exitcode==2 in most code paths:

Index: tools/server-side/svnauthz-validate.c
===================================================================
--- tools/server-side/svnauthz-validate.c (revision 1396152)
+++ tools/server-side/svnauthz-validate.c (working copy)
@@ -88,10 +88,12 @@ main(int argc, const char **argv)
   /* Repeat svn_cmdline__getopt_init() inline. */
   apr_err = apr_getopt_init(&os, pool, argc, argv);
   if (apr_err)
- return svn_cmdline_handle_exit_error(
- svn_error_wrap_apr(apr_err,
- ("Error initializing command line arguments")),
- pool, "svn-rep-sharing-stats: ");
+ {
+ err = svn_error_wrap_apr(apr_err,
+ ("Error initializing command line arguments"));
+ svn_handle_warning2(stderr, err, "svnauthz-validate: ");
+ return 2;
+ }
 
   os->interleave = 1;
   while (1)
@@ -131,8 +133,15 @@ main(int argc, const char **argv)
     }
 
   /* Grab AUTHZ_FILE from argv. */
- SVN_INT_ERR(svn_utf_cstring_to_utf8(&opts.authz_file, os->argv[os->ind],
- pool));
+ err = svn_utf_cstring_to_utf8(&opts.authz_file, os->argv[os->ind],
+ pool);
+ if (err)
+ {
+ svn_handle_warning2(stderr, err, "svnauthz-validate: ");
+ svn_error_clear(err);
+ return 2;
+ }
+
   opts.authz_file = svn_dirent_internal_style(opts.authz_file, pool);
 
   /* Read the access file and validate it. */
Received on 2012-10-09 20:30:24 CEST

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