* fhandler.h (fhandler_base::fstat_helper): Declare timestamps as

PLARGE_INTEGER.
	* fhandler_disk_file.cc (fhandler_base::fstat_by_handle):
	Accommodate fstat_helper change of timestamp arguments.
	(fhandler_base::fstat_by_name): Ditto.
	(fhandler_base::fstat_helper): Define with timestamps as PLARGE_INTEGER.
	Accommodate in call to to_timestruc_t.
This commit is contained in:
Corinna Vinschen 2010-01-10 11:12:52 +00:00
parent 7bc1f6c6c1
commit f1817d368a
3 changed files with 39 additions and 31 deletions

View File

@ -1,3 +1,13 @@
2010-01-10 Corinna Vinschen <corinna@vinschen.de>
* fhandler.h (fhandler_base::fstat_helper): Declare timestamps as
PLARGE_INTEGER.
* fhandler_disk_file.cc (fhandler_base::fstat_by_handle):
Accommodate fstat_helper change of timestamp arguments.
(fhandler_base::fstat_by_name): Ditto.
(fhandler_base::fstat_helper): Define with timestamps as PLARGE_INTEGER.
Accommodate in call to to_timestruc_t.
2010-01-08 Corinna Vinschen <corinna@vinschen.de>
* sec_auth.cc (get_token_group_sidlist): Add BUILTIN\Users account

View File

@ -1,7 +1,7 @@
/* fhandler.h
Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
2005, 2006, 2007, 2008, 2009 Red Hat, Inc.
2005, 2006, 2007, 2008, 2009, 2010 Red Hat, Inc.
This file is part of Cygwin.
@ -280,10 +280,10 @@ class fhandler_base
virtual int __stdcall fstat (struct __stat64 *buf) __attribute__ ((regparm (2)));
int __stdcall fstat_fs (struct __stat64 *buf) __attribute__ ((regparm (2)));
int __stdcall fstat_helper (struct __stat64 *buf,
FILETIME ftChangeTime,
FILETIME ftLastAccessTime,
FILETIME ftLastWriteTime,
FILETIME ftCreationTime,
PLARGE_INTEGER ChangeTime,
PLARGE_INTEGER LastAccessTime,
PLARGE_INTEGER LastWriteTime,
PLARGE_INTEGER CreationTime,
DWORD dwVolumeSerialNumber,
ULONGLONG nFileSize,
LONGLONG nAllocSize,

View File

@ -1,7 +1,7 @@
/* fhandler_disk_file.cc
Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
2005, 2006, 2007, 2008, 2009 Red Hat, Inc.
2005, 2006, 2007, 2008, 2009, 2010 Red Hat, Inc.
This file is part of Cygwin.
@ -372,12 +372,11 @@ fhandler_base::fstat_by_handle (struct __stat64 *buf)
fbi.FileAttributes &= ~FILE_ATTRIBUTE_DIRECTORY;
pc.file_attributes (fbi.FileAttributes);
return fstat_helper (buf,
fbi.ChangeTime.QuadPart
? *(FILETIME *) (void *) &fbi.ChangeTime
: *(FILETIME *) (void *) &fbi.LastWriteTime,
*(FILETIME *) (void *) &fbi.LastAccessTime,
*(FILETIME *) (void *) &fbi.LastWriteTime,
*(FILETIME *) (void *) &fbi.CreationTime,
fbi.ChangeTime.QuadPart ? &fbi.ChangeTime
: &fbi.LastWriteTime,
&fbi.LastAccessTime,
&fbi.LastWriteTime,
&fbi.CreationTime,
get_dev (),
fsi.EndOfFile.QuadPart,
fsi.AllocationSize.QuadPart,
@ -440,12 +439,11 @@ fhandler_base::fstat_by_name (struct __stat64 *buf)
fdi_buf.fdi.FileAttributes &= ~FILE_ATTRIBUTE_DIRECTORY;
pc.file_attributes (fdi_buf.fdi.FileAttributes);
return fstat_helper (buf,
fdi_buf.fdi.ChangeTime.QuadPart ?
*(FILETIME *) (void *) &fdi_buf.fdi.ChangeTime :
*(FILETIME *) (void *) &fdi_buf.fdi.LastWriteTime,
*(FILETIME *) (void *) &fdi_buf.fdi.LastAccessTime,
*(FILETIME *) (void *) &fdi_buf.fdi.LastWriteTime,
*(FILETIME *) (void *) &fdi_buf.fdi.CreationTime,
fdi_buf.fdi.ChangeTime.QuadPart
? &fdi_buf.fdi.ChangeTime : &fdi_buf.fdi.LastWriteTime,
&fdi_buf.fdi.LastAccessTime,
&fdi_buf.fdi.LastWriteTime,
&fdi_buf.fdi.CreationTime,
pc.fs_serial_number (),
fdi_buf.fdi.EndOfFile.QuadPart,
fdi_buf.fdi.AllocationSize.QuadPart,
@ -458,10 +456,10 @@ too_bad:
/* Arbitrary value: 2006-12-01 */
RtlSecondsSince1970ToTime (1164931200L, &ft);
return fstat_helper (buf,
*(FILETIME *) (void *) &ft,
*(FILETIME *) (void *) &ft,
*(FILETIME *) (void *) &ft,
*(FILETIME *) (void *) &ft,
&ft,
&ft,
&ft,
&ft,
0,
0ULL,
-1LL,
@ -506,7 +504,7 @@ fhandler_base::fstat_fs (struct __stat64 *buf)
return res;
}
/* The ftChangeTime is taken from the NTFS ChangeTime entry, if reading
/* The ChangeTime is taken from the NTFS ChangeTime entry, if reading
the file information using NtQueryInformationFile succeeded. If not,
it's faked using the LastWriteTime entry from GetFileInformationByHandle
or FindFirstFile. We're deliberatly not using the creation time anymore
@ -518,10 +516,10 @@ fhandler_base::fstat_fs (struct __stat64 *buf)
the latter might be old and not reflect the actual state of the file. */
int __stdcall
fhandler_base::fstat_helper (struct __stat64 *buf,
FILETIME ftChangeTime,
FILETIME ftLastAccessTime,
FILETIME ftLastWriteTime,
FILETIME ftCreationTime,
PLARGE_INTEGER ChangeTime,
PLARGE_INTEGER LastAccessTime,
PLARGE_INTEGER LastWriteTime,
PLARGE_INTEGER CreationTime,
DWORD dwVolumeSerialNumber,
ULONGLONG nFileSize,
LONGLONG nAllocSize,
@ -532,10 +530,10 @@ fhandler_base::fstat_helper (struct __stat64 *buf,
IO_STATUS_BLOCK st;
FILE_COMPRESSION_INFORMATION fci;
to_timestruc_t (&ftLastAccessTime, &buf->st_atim);
to_timestruc_t (&ftLastWriteTime, &buf->st_mtim);
to_timestruc_t (&ftChangeTime, &buf->st_ctim);
to_timestruc_t (&ftCreationTime, &buf->st_birthtim);
to_timestruc_t ((PFILETIME) LastAccessTime, &buf->st_atim);
to_timestruc_t ((PFILETIME) LastWriteTime, &buf->st_mtim);
to_timestruc_t ((PFILETIME) ChangeTime, &buf->st_ctim);
to_timestruc_t ((PFILETIME) CreationTime, &buf->st_birthtim);
buf->st_dev = dwVolumeSerialNumber;
buf->st_size = (_off64_t) nFileSize;
/* The number of links to a directory includes the