From 4243412aa5a9443a696cba6198a0daac3100ef3c Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Thu, 15 Jul 2004 14:56:05 +0000 Subject: * fhandler.h (class fhandler_dev_raw): Remove is_writing flag. Remove declaration of writebuf. (class fhandler_dev_floppy): Remove declaration of close. * fhandler_floppy.cc (fhandler_dev_floppy::close): Delete. (fhandler_dev_floppy::lseek): Remove calls to writebuf. Set eom_detected to false after successful seek. * fhandler_raw.cc (fhandler_dev_raw::writebuf): Delete. (fhandler_dev_raw::raw_read): Remove calls to writebuf. (fhandler_dev_raw::raw_write): Always invalidate buffer. --- winsup/cygwin/fhandler_floppy.cc | 24 +++--------------------- 1 file changed, 3 insertions(+), 21 deletions(-) (limited to 'winsup/cygwin/fhandler_floppy.cc') diff --git a/winsup/cygwin/fhandler_floppy.cc b/winsup/cygwin/fhandler_floppy.cc index 2d17d99..88204db 100644 --- a/winsup/cygwin/fhandler_floppy.cc +++ b/winsup/cygwin/fhandler_floppy.cc @@ -66,20 +66,6 @@ fhandler_dev_floppy::open (int flags, mode_t) return fhandler_dev_raw::open (flags); } -int -fhandler_dev_floppy::close (void) -{ - int ret; - - ret = writebuf (); - if (ret) - { - fhandler_dev_raw::close (); - return ret; - } - return fhandler_dev_raw::close (); -} - _off64_t fhandler_dev_floppy::lseek (_off64_t offset, int whence) { @@ -144,10 +130,8 @@ fhandler_dev_floppy::lseek (_off64_t offset, int whence) return -1; } current_position = low + ((_off64_t) high << 32); - if (is_writing ()) - current_position += devbufend - devbufstart; - else - current_position -= devbufend - devbufstart; + /* devbufend and devbufstart are always 0 when writing. */ + current_position -= devbufend - devbufstart; lloffset += current_position; whence = SEEK_SET; @@ -167,9 +151,6 @@ fhandler_dev_floppy::lseek (_off64_t offset, int whence) if (whence == SEEK_SET) { /* Invalidate buffer. */ - ret = writebuf (); - if (ret) - return ret; devbufstart = devbufend = 0; low = sector_aligned_offset & UINT32_MAX; @@ -181,6 +162,7 @@ fhandler_dev_floppy::lseek (_off64_t offset, int whence) return -1; } + eom_detected (false); size_t len = bytes_left; raw_read (buf, len); return sector_aligned_offset + bytes_left; -- cgit v1.1