apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Erik Huelsmann" <ehu...@gmail.com>
Subject EISDIR / EPERM not categorised in APR_STATUS_IS_* macros
Date Tue, 11 Sep 2007 21:25:20 GMT
While working on changing some of the working copy library in
Subversion, I'm trying to eliminate stat() calls (apr_stat()) in order
to speed up overall operation.

Very often, Subversion libsvn_wc uses this pattern:

svn_io_check_path() -> retrieves a path kind using apr_stat()
if (kind == directory)

Where dir and file thing could be just removal.

The common case in the routines I'm looking at happens to be file
removal. So, to reduce the number of stats, I want to replace the
stat()+unlink() with a single unlink(), checking the result for
certain types of failure.

Reading the man 2 unlink page, EPERM is returned for POSIXy unices
when deleting a directory, whereas EISDIR is returned on Linux. (MSDN
isn't quite clear about Win32 behaviour...)

Neither EPERM nor EISDIR have been categorised in any of the
APR_STATUS_IS_* macros. I searched the mailing list archives at MARC,
but found only an old mail by Branko which suggests this part of the
error codes is unfinished business. Now, before I start working up any
patches:  Is that true, or is this missing with intent?




View raw message