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

Re: svn commit: r1222699 - /subversion/trunk/subversion/libsvn_ra_svn/cyrus_auth.c

From: Daniel Shahaf <d.s_at_daniel.shahaf.name>
Date: Sat, 24 Dec 2011 17:01:04 +0200

rhuijben_at_apache.org wrote on Fri, Dec 23, 2011 at 15:07:32 -0000:
> Author: rhuijben
> Date: Fri Dec 23 15:07:32 2011
> New Revision: 1222699
>
> URL: http://svn.apache.org/viewvc?rev=1222699&view=rev
> Log:
> * dev/subversion/libsvn_ra_svn/cyrus_auth.c
> (get_sasl_errno_msg): Use apr to retrieve the error code in a more portable
> way than fetching errno. This fetches the OS error on Windows.
>
> Modified:
> subversion/trunk/subversion/libsvn_ra_svn/cyrus_auth.c
>
> Modified: subversion/trunk/subversion/libsvn_ra_svn/cyrus_auth.c
> URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_svn/cyrus_auth.c?rev=1222699&r1=1222698&r2=1222699&view=diff
> ==============================================================================
> --- subversion/trunk/subversion/libsvn_ra_svn/cyrus_auth.c (original)
> +++ subversion/trunk/subversion/libsvn_ra_svn/cyrus_auth.c Fri Dec 23 15:07:32 2011
> @@ -346,10 +346,9 @@ get_sasl_errno_msg(int result, apr_pool_
> {
> char buf[1024];
>
> - if (result == SASL_FAIL && errno != 0)
> + if (result == SASL_FAIL && apr_get_os_error() != 0)
> return apr_psprintf(result_pool, ": %s",
> - svn_strerror(APR_FROM_OS_ERROR(errno),
> - buf, sizeof(buf)));
> + svn_strerror(apr_get_os_error(), buf, sizeof(buf)));

Call apr_get_os_error() just once, and store the result in a variable?

(This at least avoids a system call, even if the call is idempotent...)

> return "";
> }
>
>
>
Received on 2011-12-24 16:01:50 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.