Checkout
kotkov
committed
on 20 Aug
Win32: fix an incorrect error status being propagated to the caller in case
where we fail to stat the destination path while being in the mi… Show more
Win32: fix an incorrect error status being propagated to the caller in case

where we fail to stat the destination path while being in the middle of a

failed rename.

So, if we fail to stat the destination in the middle of such rename, propagate

the *original* error.  Because overriding the original error with the new one

loses information about the actual cause of failure and may even confuse some

of the callers, who for instance attempt to recover in case of an EACCES,

since they may not be receiving that error at all.

(This is the behavior we had for a long time, even before r1865518, but now

seems to be an appropriate moment to fix that)

* subversion/libsvn_subr/io.c

 (win32_file_rename): Use a separate `stat_err` for the case of the failed

  GetFileAttributes() call.  If we failed to stat the file, return the

  original `err` status to the caller.

Show less