Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'winsup/cygwin/fhandler/base.cc')
-rw-r--r--winsup/cygwin/fhandler/base.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/winsup/cygwin/fhandler/base.cc b/winsup/cygwin/fhandler/base.cc
index d859870cb..b93366254 100644
--- a/winsup/cygwin/fhandler/base.cc
+++ b/winsup/cygwin/fhandler/base.cc
@@ -776,6 +776,15 @@ fhandler_base::open (int flags, mode_t mode)
NtClose (fh);
goto done;
}
+ /* Drop sparseness */
+ if (pc.file_attributes () & FILE_ATTRIBUTE_SPARSE_FILE)
+ {
+ FILE_SET_SPARSE_BUFFER fssb = { SetSparse: FALSE };
+ status = NtFsControlFile (fh, NULL, NULL, NULL, &io,
+ FSCTL_SET_SPARSE, &fssb, sizeof fssb, NULL, 0);
+ if (NT_SUCCESS (status))
+ pc.file_attributes (pc.file_attributes () & ~FILE_ATTRIBUTE_SPARSE_FILE);
+ }
}
set_handle (fh);