rhuij...@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 "";
>  }
>  
> 
> 

Reply via email to