]> sourceware.org Git - newlib-cygwin.git/commitdiff
* fhandler.h (fhandler_base::fstat_helper): Declare with additional
authorCorinna Vinschen <corinna@vinschen.de>
Sun, 20 Feb 2005 16:14:53 +0000 (16:14 +0000)
committerCorinna Vinschen <corinna@vinschen.de>
Sun, 20 Feb 2005 16:14:53 +0000 (16:14 +0000)
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/ChangeLog
winsup/cygwin/fhandler.h
winsup/cygwin/fhandler_disk_file.cc

index 13b941efdd6d7ecd8cf72b8d25a40960872a4934..d6adc5af176cfbc0e6a42935671f426ba4812850 100644 (file)
@@ -1,3 +1,16 @@
+2005-02-20  Corinna Vinschen  <corinna@vinschen.de>
+
+       * 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.
+
 2005-02-20  Corinna Vinschen  <corinna@vinschen.de>
 
        * autoload.cc (FindFirstVolumeA): Add.
index 34b0f20f41ea758bab3c670461ef1f888c7b55ea..3199351ceb6cb1c2e14298bac19a626147487d44 100644 (file)
@@ -250,14 +250,15 @@ 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 ftCreateionTime,
+                             FILETIME ftCreationTime,
                              FILETIME ftLastAccessTime,
                              FILETIME ftLastWriteTime,
+                             DWORD dwVolumeSerialNumber,
                              DWORD nFileSizeHigh,
                              DWORD nFileSizeLow,
-                             DWORD nFileIndexHigh = 0,
-                             DWORD nFileIndexLow = 0,
-                             DWORD nNumberOfLinks = 1)
+                             DWORD nFileIndexHigh,
+                             DWORD nFileIndexLow,
+                             DWORD nNumberOfLinks)
     __attribute__ ((regparm (3)));
   int __stdcall fstat_by_handle (struct __stat64 *buf) __attribute__ ((regparm (2)));
   int __stdcall fstat_by_name (struct __stat64 *buf) __attribute__ ((regparm (2)));
index 5b057dbbd1f2b802c23c1cc64e9107011a49c900..dab34a453301bf5da7871cf228bee0be36463399 100644 (file)
@@ -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
This page took 0.036638 seconds and 5 git commands to generate.