OSDN Git Service

* fhandler_floppy.cc (fhandler_floppy::lseek): Remove iswinnt check.
authorcorinna <corinna>
Wed, 5 Sep 2001 10:14:15 +0000 (10:14 +0000)
committercorinna <corinna>
Wed, 5 Sep 2001 10:14:15 +0000 (10:14 +0000)
winsup/cygwin/ChangeLog
winsup/cygwin/fhandler_floppy.cc

index c412c7f..ba5cd3a 100644 (file)
@@ -1,3 +1,7 @@
+Wed Sep  5 12:12:00 2001  Corinna Vinschen <corinna@vinschen.de>
+
+       * fhandler_floppy.cc (fhandler_floppy::lseek): Remove iswinnt check.
+
 Wed Sep  5 11:34:00 2001  Corinna Vinschen <corinna@vinschen.de>
 
        * fhandler_socket.cc (fhandler_socket::close): Change 2MSL value
index 2160d26..471b16b 100644 (file)
@@ -91,44 +91,41 @@ fhandler_dev_floppy::lseek (off_t offset, int whence)
   DWORD low;
   LONG high = 0;
 
-  if (iswinnt)
+  DISK_GEOMETRY di;
+  PARTITION_INFORMATION pi;
+  DWORD bytes_read;
+
+  if (!DeviceIoControl (get_handle(),
+                         IOCTL_DISK_GET_DRIVE_GEOMETRY,
+                         NULL, 0,
+                         &di, sizeof (di),
+                         &bytes_read, NULL))
     {
-      DISK_GEOMETRY di;
-      PARTITION_INFORMATION pi;
-      DWORD bytes_read;
-
-      if (!DeviceIoControl (get_handle(),
-                              IOCTL_DISK_GET_DRIVE_GEOMETRY,
-                              NULL, 0,
-                              &di, sizeof (di),
-                              &bytes_read, NULL))
-        {
-          __seterrno ();
-          return -1;
-        }
-      debug_printf ("disk geometry: (%ld cyl)*(%ld trk)*(%ld sec)*(%ld bps)",
-                     di.Cylinders.LowPart,
-                     di.TracksPerCylinder,
-                     di.SectorsPerTrack,
-                     di.BytesPerSector);
-      if (DeviceIoControl (get_handle (),
-                             IOCTL_DISK_GET_PARTITION_INFO,
-                             NULL, 0,
-                             &pi, sizeof (pi),
-                             &bytes_read, NULL))
-        {
-          debug_printf ("partition info: %ld (%ld)",
-                          pi.StartingOffset.LowPart,
-                          pi.PartitionLength.LowPart);
-          drive_size = (long long) pi.PartitionLength.QuadPart;
-        }
-      else
-        {
-          drive_size = (long long) di.Cylinders.QuadPart * di.TracksPerCylinder *
-                       di.SectorsPerTrack * di.BytesPerSector;
-        }
-      debug_printf ("drive size: %ld", drive_size);
+      __seterrno ();
+      return -1;
+    }
+  debug_printf ("disk geometry: (%ld cyl)*(%ld trk)*(%ld sec)*(%ld bps)",
+                di.Cylinders.LowPart,
+                di.TracksPerCylinder,
+                di.SectorsPerTrack,
+                di.BytesPerSector);
+  if (DeviceIoControl (get_handle (),
+                        IOCTL_DISK_GET_PARTITION_INFO,
+                        NULL, 0,
+                        &pi, sizeof (pi),
+                        &bytes_read, NULL))
+    {
+      debug_printf ("partition info: %ld (%ld)",
+                     pi.StartingOffset.LowPart,
+                     pi.PartitionLength.LowPart);
+      drive_size = (long long) pi.PartitionLength.QuadPart;
+    }
+  else
+    {
+      drive_size = (long long) di.Cylinders.QuadPart * di.TracksPerCylinder *
+                  di.SectorsPerTrack * di.BytesPerSector;
     }
+  debug_printf ("drive size: %ld", drive_size);
 
   if (whence == SEEK_END && drive_size > 0)
     {