* fhandler.cc (fhandler_base::fstat): Initialise tv_nsec member of

st_atim, st_mtim, and st_ctim fields.
	* fhandler_disk_file.cc (fhandler_disk_file::fstat_helper): Ditto.
	* fhandler_process.cc (fhandler_process::fstat): Ditto.
	* glob.c (stat32_to_STAT): Copy across the whole st_atim,
	st_mtime, and st_ctim fields.
	* syscalls.cc (stat64_to_stat32): Ditto.
	* times.cc (to_timestruc_t): New function.
	(time_as_timestruc_t): New function.
	* winsup.h: Add to_timestruc_t and time_as_timestruc_t functions.
	* include/cygwin/stat.h: Replace time_t with timestruc_t
	throughout for all file times, removing the st_spare1, st_spare2,
	and st_spare3 fields in the process. Add macros to access tv_sec
	fields by old names.
	* include/cygwin/types.h: Typedef timespec_t and timestruc_t as
	struct timespec.
This commit is contained in:
Corinna Vinschen
2002-06-06 15:35:09 +00:00
parent a81cc3be2a
commit c4e6ff484c
10 changed files with 90 additions and 29 deletions

View File

@@ -200,9 +200,9 @@ fhandler_disk_file::fstat_helper (struct __stat64 *buf, path_conv *pc,
&& ftCreationTime.dwHighDateTime == 0)
ftCreationTime = ftLastWriteTime;
buf->st_atime = to_time_t (&ftLastAccessTime);
buf->st_mtime = to_time_t (&ftLastWriteTime);
buf->st_ctime = to_time_t (&ftCreationTime);
to_timestruc_t (&ftLastAccessTime, &buf->st_atim);
to_timestruc_t (&ftLastWriteTime, &buf->st_mtim);
to_timestruc_t (&ftCreationTime, &buf->st_ctim);
buf->st_nlink = nNumberOfLinks;
buf->st_dev = pc->volser ();
buf->st_size = ((__off64_t)nFileSizeHigh << 32) + nFileSizeLow;