From 37c23731c72a9c840b596819e4c75a0ef9280faf Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Wed, 5 Sep 2001 10:14:15 +0000 Subject: [PATCH] * fhandler_floppy.cc (fhandler_floppy::lseek): Remove iswinnt check. --- winsup/cygwin/ChangeLog | 4 ++ winsup/cygwin/fhandler_floppy.cc | 69 +++++++++++++++----------------- 2 files changed, 37 insertions(+), 36 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index c412c7f78..ba5cd3aaf 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,7 @@ +Wed Sep 5 12:12:00 2001 Corinna Vinschen + + * fhandler_floppy.cc (fhandler_floppy::lseek): Remove iswinnt check. + Wed Sep 5 11:34:00 2001 Corinna Vinschen * fhandler_socket.cc (fhandler_socket::close): Change 2MSL value diff --git a/winsup/cygwin/fhandler_floppy.cc b/winsup/cygwin/fhandler_floppy.cc index 2160d2693..471b16b18 100644 --- a/winsup/cygwin/fhandler_floppy.cc +++ b/winsup/cygwin/fhandler_floppy.cc @@ -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; + 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); + 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); if (whence == SEEK_END && drive_size > 0) {