From 4e5a3fa5e2cc0ce5365fd6bd0bfa43f73ba17b55 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Sun, 20 Feb 2005 16:14:53 +0000 Subject: * fhandler.h (fhandler_base::fstat_helper): Declare with additional dwVolumeSerialNumber argument. Drop default values for last three arguments. * fhandler_disk_file.cc (fhandler_base::fstat_by_handle): Pass dwVolumeSerialNumber from GetFileInformationByHandle to fstat_helper. (fhandler_base::fstat_by_name): Pass pc.volser () to fstat_helper. Accomodate dropping default values for last three arguments of fstat_helper. (fhandler_base::fstat_helper): Add dwVolumeSerialNumber argument. Use for st_dev member unless 0 in which case pc.volser () is used. --- winsup/cygwin/fhandler_disk_file.cc | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'winsup/cygwin/fhandler_disk_file.cc') diff --git a/winsup/cygwin/fhandler_disk_file.cc b/winsup/cygwin/fhandler_disk_file.cc index 5b057dbbd..dab34a453 100644 --- a/winsup/cygwin/fhandler_disk_file.cc +++ b/winsup/cygwin/fhandler_disk_file.cc @@ -114,6 +114,7 @@ fhandler_base::fstat_by_handle (struct __stat64 *buf) local.ftCreationTime, local.ftLastAccessTime, local.ftLastWriteTime, + local.dwVolumeSerialNumber, local.nFileSizeHigh, local.nFileSizeLow, local.nFileIndexHigh, @@ -141,13 +142,17 @@ fhandler_base::fstat_by_name (struct __stat64 *buf) local.ftCreationTime, local.ftLastAccessTime, local.ftLastWriteTime, + pc.volser (), local.nFileSizeHigh, - local.nFileSizeLow); + local.nFileSizeLow, + 0, + 0, + 1); } else if (pc.isdir ()) { FILETIME ft = {}; - res = fstat_helper (buf, ft, ft, ft, 0, 0); + res = fstat_helper (buf, ft, ft, ft, pc.volser (), 0, 0, 0, 0, 1); } else { @@ -213,6 +218,7 @@ fhandler_base::fstat_helper (struct __stat64 *buf, FILETIME ftCreationTime, FILETIME ftLastAccessTime, FILETIME ftLastWriteTime, + DWORD dwVolumeSerialNumber, DWORD nFileSizeHigh, DWORD nFileSizeLow, DWORD nFileIndexHigh, @@ -233,7 +239,7 @@ fhandler_base::fstat_helper (struct __stat64 *buf, to_timestruc_t (&ftLastAccessTime, &buf->st_atim); to_timestruc_t (&ftLastWriteTime, &buf->st_mtim); to_timestruc_t (&ftCreationTime, &buf->st_ctim); - buf->st_dev = pc.volser (); + buf->st_dev = dwVolumeSerialNumber ?: pc.volser (); buf->st_size = ((_off64_t) nFileSizeHigh << 32) + nFileSizeLow; /* The number of links to a directory includes the number of subdirectories in the directory, since all -- cgit v1.2.3