summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2008-05-15 17:23:29 +0000
committerCorinna Vinschen <corinna@vinschen.de>2008-05-15 17:23:29 +0000
commitb61251603a545d205a3776bedf9eb126f9c7efb6 (patch)
tree0dd5a525c641bc94bf4129fcc27d032684307980
parent13b9bb622105f620d603d717e7919874e081ebef (diff)
downloadcygnal-b61251603a545d205a3776bedf9eb126f9c7efb6.tar.gz
cygnal-b61251603a545d205a3776bedf9eb126f9c7efb6.tar.bz2
cygnal-b61251603a545d205a3776bedf9eb126f9c7efb6.zip
* syscalls.cc (rename): ONly start transaction if FS supports them.
-rw-r--r--winsup/cygwin/ChangeLog4
-rw-r--r--winsup/cygwin/syscalls.cc5
2 files changed, 8 insertions, 1 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 4bc83a643..1d39423a3 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,5 +1,9 @@
2008-05-15 Corinna Vinschen <corinna@vinschen.de>
+ * syscalls.cc (rename): ONly start transaction if FS supports them.
+
+2008-05-15 Corinna Vinschen <corinna@vinschen.de>
+
* autoload.cc (LoadDLLfuncNt): Re-invent.
(NtCreateTransaction): Define.
(NtCommitTransaction): Define.
diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc
index af3d0ad17..4f35b6b69 100644
--- a/winsup/cygwin/syscalls.cc
+++ b/winsup/cygwin/syscalls.cc
@@ -1716,6 +1716,7 @@ rename (const char *oldpath, const char *newpath)
to call only NtSetInformationFile under the transaction. Therefore we
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)))
start_transaction (old_trans, trans);
@@ -1829,7 +1830,9 @@ rename (const char *oldpath, const char *newpath)
destination before renaming. */
if (status == STATUS_ACCESS_DENIED && dstpc->exists () && !dstpc->isdir ())
{
- if (wincap.has_transactions () && !trans)
+ if (wincap.has_transactions ()
+ && (dstpc->fs_flags () & FILE_SUPPORTS_TRANSACTIONS)
+ && !trans)
{
start_transaction (old_trans, trans);
/* As mentioned earlier, opening the file must be part of the