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

Re: svn commit: rev 1062 - trunk/subversion/clients/cmdline

From: Greg Stein <gstein_at_lyra.org>
Date: 2002-01-25 20:14:47 CET

On Fri, Jan 25, 2002 at 11:43:45AM -0600, kfogel@tigris.org wrote:
> Author: kfogel
> Date: 2002-01-25 17:43 GMT
> New Revision: 1062
>
> Modified:
> trunk/subversion/clients/cmdline/commit-cmd.c
> Log:
> * subversion/clients/cmdline/commit-cmd.c (message_from_editor): Use
> apr_file_write_full, not apr_file_write; if the latter were used, it
> would have had to be in a loop. Use APR_STATUS_IS_SUCCESS to check
> return code.

You asked me once about APR_STATUS_IS_SUCCESS ...

IMO, the macro is bogus. The other apr_errno macros are used to check the
status against multiple errors, based on the platform you're on. (e.g. a
file not found might have several possibilities on Windows)

But there is only /one/ "success" code. So testing directly against
APR_SUCCESS is quite legal:

    if (status == APR_SUCCESS) ...

Furthermore, APR_SUCCESS is *guaranteed* to be zero. That is its definition.
So it is also quite legal to simply say:

    if (status) ...

Personally, I'd suggest that we *not use* the macro. Testing against
APR_SUCCESS explicitly is a personal preference. But the macro is
obfuscating what is otherwise a simple semantic.

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Oct 21 14:37:00 2006

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.