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