Drop has_transactions flag

This commit is contained in:
Corinna Vinschen 2015-12-15 15:19:05 +01:00
parent ffcef702e7
commit 9aab8eb5b6
3 changed files with 3 additions and 16 deletions

View File

@ -677,8 +677,7 @@ unlink_nt (path_conv &pc)
/* If possible, hide the non-atomicity of the "remove R/O flag, remove /* If possible, hide the non-atomicity of the "remove R/O flag, remove
link to file" operation behind a transaction. */ link to file" operation behind a transaction. */
if (wincap.has_transactions () if ((pc.fs_flags () & FILE_SUPPORTS_TRANSACTIONS))
&& (pc.fs_flags () & FILE_SUPPORTS_TRANSACTIONS))
start_transaction (old_trans, trans); start_transaction (old_trans, trans);
retry_open: retry_open:
status = NtOpenFile (&fh_ro, FILE_WRITE_ATTRIBUTES, &attr, &io, status = NtOpenFile (&fh_ro, FILE_WRITE_ATTRIBUTES, &attr, &io,
@ -2346,8 +2345,7 @@ rename (const char *oldpath, const char *newpath)
/* Opening the file must be part of the transaction. It's not sufficient /* Opening the file must be part of the transaction. It's not sufficient
to call only NtSetInformationFile under the transaction. Therefore we to call only NtSetInformationFile under the transaction. Therefore we
have to start the transaction here, if necessary. */ have to start the transaction here, if necessary. */
if (wincap.has_transactions () if ((dstpc->fs_flags () & FILE_SUPPORTS_TRANSACTIONS)
&& (dstpc->fs_flags () & FILE_SUPPORTS_TRANSACTIONS)
&& (dstpc->isdir () && (dstpc->isdir ()
|| (!removepc && dstpc->has_attribute (FILE_ATTRIBUTE_READONLY)))) || (!removepc && dstpc->has_attribute (FILE_ATTRIBUTE_READONLY))))
start_transaction (old_trans, trans); start_transaction (old_trans, trans);
@ -2516,9 +2514,7 @@ rename (const char *oldpath, const char *newpath)
if (status == STATUS_ACCESS_DENIED && dstpc->exists () if (status == STATUS_ACCESS_DENIED && dstpc->exists ()
&& !dstpc->isdir ()) && !dstpc->isdir ())
{ {
if (wincap.has_transactions () if ((dstpc->fs_flags () & FILE_SUPPORTS_TRANSACTIONS) && !trans)
&& (dstpc->fs_flags () & FILE_SUPPORTS_TRANSACTIONS)
&& !trans)
{ {
start_transaction (old_trans, trans); start_transaction (old_trans, trans);
/* As mentioned earlier, opening the file must be part of the /* As mentioned earlier, opening the file must be part of the

View File

@ -23,7 +23,6 @@ wincaps wincap_xpsp2 __attribute__((section (".cygwin_dll_common"), shared)) = {
is_server:false, is_server:false,
needs_count_in_si_lpres2:false, needs_count_in_si_lpres2:false,
has_gaa_largeaddress_bug:false, has_gaa_largeaddress_bug:false,
has_transactions:false,
has_broken_alloc_console:false, has_broken_alloc_console:false,
has_restricted_raw_disk_access:false, has_restricted_raw_disk_access:false,
use_dont_resolve_hack:true, use_dont_resolve_hack:true,
@ -48,7 +47,6 @@ wincaps wincap_2003 __attribute__((section (".cygwin_dll_common"), shared)) = {
is_server:false, is_server:false,
needs_count_in_si_lpres2:false, needs_count_in_si_lpres2:false,
has_gaa_largeaddress_bug:false, has_gaa_largeaddress_bug:false,
has_transactions:false,
has_broken_alloc_console:false, has_broken_alloc_console:false,
has_restricted_raw_disk_access:false, has_restricted_raw_disk_access:false,
use_dont_resolve_hack:true, use_dont_resolve_hack:true,
@ -73,7 +71,6 @@ wincaps wincap_vista __attribute__((section (".cygwin_dll_common"), shared)) = {
is_server:false, is_server:false,
needs_count_in_si_lpres2:true, needs_count_in_si_lpres2:true,
has_gaa_largeaddress_bug:true, has_gaa_largeaddress_bug:true,
has_transactions:true,
has_broken_alloc_console:false, has_broken_alloc_console:false,
has_restricted_raw_disk_access:true, has_restricted_raw_disk_access:true,
use_dont_resolve_hack:false, use_dont_resolve_hack:false,
@ -98,7 +95,6 @@ wincaps wincap_7 __attribute__((section (".cygwin_dll_common"), shared)) = {
is_server:false, is_server:false,
needs_count_in_si_lpres2:false, needs_count_in_si_lpres2:false,
has_gaa_largeaddress_bug:true, has_gaa_largeaddress_bug:true,
has_transactions:true,
has_broken_alloc_console:true, has_broken_alloc_console:true,
has_restricted_raw_disk_access:true, has_restricted_raw_disk_access:true,
use_dont_resolve_hack:false, use_dont_resolve_hack:false,
@ -123,7 +119,6 @@ wincaps wincap_8 __attribute__((section (".cygwin_dll_common"), shared)) = {
is_server:false, is_server:false,
needs_count_in_si_lpres2:false, needs_count_in_si_lpres2:false,
has_gaa_largeaddress_bug:false, has_gaa_largeaddress_bug:false,
has_transactions:true,
has_broken_alloc_console:true, has_broken_alloc_console:true,
has_restricted_raw_disk_access:true, has_restricted_raw_disk_access:true,
use_dont_resolve_hack:false, use_dont_resolve_hack:false,
@ -148,7 +143,6 @@ wincaps wincap_10 __attribute__((section (".cygwin_dll_common"), shared)) = {
is_server:false, is_server:false,
needs_count_in_si_lpres2:false, needs_count_in_si_lpres2:false,
has_gaa_largeaddress_bug:false, has_gaa_largeaddress_bug:false,
has_transactions:true,
has_broken_alloc_console:true, has_broken_alloc_console:true,
has_restricted_raw_disk_access:true, has_restricted_raw_disk_access:true,
use_dont_resolve_hack:false, use_dont_resolve_hack:false,
@ -173,7 +167,6 @@ wincaps wincap_10_1511 __attribute__((section (".cygwin_dll_common"), shared)) =
is_server:false, is_server:false,
needs_count_in_si_lpres2:false, needs_count_in_si_lpres2:false,
has_gaa_largeaddress_bug:false, has_gaa_largeaddress_bug:false,
has_transactions:true,
has_broken_alloc_console:true, has_broken_alloc_console:true,
has_restricted_raw_disk_access:true, has_restricted_raw_disk_access:true,
use_dont_resolve_hack:false, use_dont_resolve_hack:false,

View File

@ -16,7 +16,6 @@ struct wincaps
unsigned is_server : 1; unsigned is_server : 1;
unsigned needs_count_in_si_lpres2 : 1; unsigned needs_count_in_si_lpres2 : 1;
unsigned has_gaa_largeaddress_bug : 1; unsigned has_gaa_largeaddress_bug : 1;
unsigned has_transactions : 1;
unsigned has_broken_alloc_console : 1; unsigned has_broken_alloc_console : 1;
unsigned has_restricted_raw_disk_access : 1; unsigned has_restricted_raw_disk_access : 1;
unsigned use_dont_resolve_hack : 1; unsigned use_dont_resolve_hack : 1;
@ -66,7 +65,6 @@ public:
bool IMPLEMENT (is_server) bool IMPLEMENT (is_server)
bool IMPLEMENT (needs_count_in_si_lpres2) bool IMPLEMENT (needs_count_in_si_lpres2)
bool IMPLEMENT (has_gaa_largeaddress_bug) bool IMPLEMENT (has_gaa_largeaddress_bug)
bool IMPLEMENT (has_transactions)
bool IMPLEMENT (has_broken_alloc_console) bool IMPLEMENT (has_broken_alloc_console)
bool IMPLEMENT (has_restricted_raw_disk_access) bool IMPLEMENT (has_restricted_raw_disk_access)
bool IMPLEMENT (use_dont_resolve_hack) bool IMPLEMENT (use_dont_resolve_hack)