summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/syscalls.cc
diff options
context:
space:
mode:
Diffstat (limited to 'winsup/cygwin/syscalls.cc')
-rw-r--r--winsup/cygwin/syscalls.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc
index 82f745bb8..aa4819d6d 100644
--- a/winsup/cygwin/syscalls.cc
+++ b/winsup/cygwin/syscalls.cc
@@ -1718,7 +1718,8 @@ rename (const char *oldpath, const char *newpath)
have to start the transaction here, if necessary. */
if (wincap.has_transactions ()
&& (dstpc->fs_flags () & FILE_SUPPORTS_TRANSACTIONS)
- && (dstpc->isdir () || dstpc->has_attribute (FILE_ATTRIBUTE_READONLY)))
+ && (dstpc->isdir ()
+ || (!removepc && dstpc->has_attribute (FILE_ATTRIBUTE_READONLY))))
start_transaction (old_trans, trans);
/* DELETE is required to rename a file. */