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

Re: svn commit: r12734 - branches/locking/subversion/libsvn_fs_fs

From: Brian W. Fitzpatrick <fitz_at_red-bean.com>
Date: 2005-01-17 22:41:29 CET

On Jan 14, 2005, at 6:41 PM, Philip Martin wrote:

> fitz@tigris.org writes:
>
>> Author: fitz
>> Date: Fri Jan 14 13:41:54 2005
>> New Revision: 12734
>
>> +/* Create a directory at PATH with the same permissions as
>> + REF_PATH. */
>> +static svn_error_t *
>> +make_dir (const char *path,
>> + const char *ref_path,
>> + apr_pool_t *pool)
>> +{
>> + svn_error_t *err;
>> +
>> + err = svn_io_dir_make (path, APR_OS_DEFAULT, pool);
>> +
>> + /* If no error, then we successfully created the directory--tweak
>> + the perms.*/
>> + if (!err)
>> + SVN_ERR (svn_fs_fs__dup_perms (path, ref_path, pool));
>> +
>> + /* Any error other than EEXIST is a real error. */
>> + if (err && !APR_STATUS_IS_EEXIST (err->apr_err))
>> + return err;
>> +
>> + /* If EEXIST, then clear the error */
>> + if (err && APR_STATUS_IS_EEXIST (err->apr_err))
>
> Having decided not to return the error don't use another if, simply
> call svn_error_clear unconditionally (it handles a NULL argument).
>
> I had to read this bit of code more than once to understand it, if
> somebody ever changes the first EEXIST test they may forget to change
> the second one.

Committed in r12769.

Thanks,

-Fitz

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Mon Jan 17 22:43:07 2005

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.