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

Re: Subversion issue 2791

From: Martin Furter <mf_at_rola.ch>
Date: Fri, 10 Dec 2010 18:08:26 +0100 (CET)

On Thu, 9 Dec 2010, C. Michael Pilato wrote:

> Hey, Martin. Do you have the time and willingness to update one of your
> patches for issue #2791? See the last comments in
> http://subversion.tigris.org/issues/show_bug.cgi?id=2791 for details.

Here's an updated patch for run_hook_cmd, but completely untested.
I'll try to compile and run the test suite soon...

But while looking at the code I think I found an error there.

static svn_error_t *
run_hook_cmd(svn_string_t **result,
...
   apr_err = apr_file_close(cmd_proc.err);
   if (!err && apr_err)
     return svn_error_wrap_apr
       (apr_err, _("Error closing read end of stderr pipe"));
If apr_file_close fails here the function returns and the stdout handle
is not closed.
I guess this should be 'err = svn_error_wrap_apr(...)' instead of return.

   if (result)
     {
       svn_stringbuf_t *native_stdout;
       SVN_ERR(svn_stringbuf_from_aprfile(&native_stdout, cmd_proc.out,
pool));
       apr_err = apr_file_close(cmd_proc.out);
       if (!err && apr_err)
         return svn_error_wrap_apr
           (apr_err, _("Error closing read end of stderr pipe"));

       *result = svn_string_create_from_buf(native_stdout, pool);
     }
   else
     {
       apr_err = apr_file_close(null_handle);
       if (!err && apr_err)
         return svn_error_wrap_apr(apr_err, _("Error closing null file"));
     }

   return svn_error_return(err);
}

- Martin

Received on 2010-12-10 18:09:21 CET

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.