diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2003-05-26 09:54:01 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2003-05-26 09:54:01 +0000 |
commit | fac297d5f84d06ec41652c42f410f105dd904b67 (patch) | |
tree | 34cd97034cede2b4fd3568d3a483ecd254e83eea /winsup/cygwin/fhandler_disk_file.cc | |
parent | 7b3a9e6e005345d47280cf93cf7dde679c651a6f (diff) | |
download | cygnal-fac297d5f84d06ec41652c42f410f105dd904b67.tar.gz cygnal-fac297d5f84d06ec41652c42f410f105dd904b67.tar.bz2 cygnal-fac297d5f84d06ec41652c42f410f105dd904b67.zip |
* fhandler.h: Rename FH_W95LSBUG flag to FH_LSEEKED.
(fhandler_base::set_did_lseek): Rename from set_check_win95_lseek_bug.
(fhandler_base::get_did_lseek): Rename from get_check_win95_lseek_bug.
(fhandler_base::set_fs_flags): New method.
(fhandler_base::get_fs_flags): Ditto.
* fhandler.cc (fhandler_base::write): Make 64 bit clean. Convert file
to a "sparse" file when writing after a long lseek (>64K) beyond EOF.
(fhandler_base::lseek): Call set_did_lseek() instead of
set_check_win95_lseek_bug().
(fhandler_base::fhandler_base): Initialize fs_flags to 0.
* fhandler_disk_file.cc (fhandler_disk_file::open): Don't create files
as "sparse" unconditionally. Set fs_flags member.
Diffstat (limited to 'winsup/cygwin/fhandler_disk_file.cc')
-rw-r--r-- | winsup/cygwin/fhandler_disk_file.cc | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/winsup/cygwin/fhandler_disk_file.cc b/winsup/cygwin/fhandler_disk_file.cc index 98d1531f4..64e1a73ce 100644 --- a/winsup/cygwin/fhandler_disk_file.cc +++ b/winsup/cygwin/fhandler_disk_file.cc @@ -26,7 +26,6 @@ details. */ #include "pinfo.h" #include <assert.h> #include <ctype.h> -#include <winioctl.h> #define _COMPILING_NEWLIB #include <dirent.h> @@ -395,19 +394,7 @@ fhandler_disk_file::open (path_conv *real_path, int flags, mode_t mode) && !allow_ntsec && allow_ntea) set_file_attribute (has_acls (), get_win32_name (), mode); - /* Set newly created and truncated files as sparse files. */ - if ((real_path->fs_flags () & FILE_SUPPORTS_SPARSE_FILES) - && (get_access () & GENERIC_WRITE) == GENERIC_WRITE - && (get_flags () & (O_CREAT | O_TRUNC))) - { - DWORD dw; - HANDLE h = get_handle (); - BOOL r = DeviceIoControl (h , FSCTL_SET_SPARSE, NULL, 0, NULL, 0, &dw, - NULL); - syscall_printf ("%d = DeviceIoControl(0x%x, FSCTL_SET_SPARSE, NULL, 0, " - "NULL, 0, &dw, NULL)", r, h); - } - + set_fs_flags (real_path->fs_flags ()); set_symlink_p (real_path->issymlink ()); set_execable_p (real_path->exec_state ()); set_socket_p (real_path->issocket ()); |