diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2004-07-15 14:56:05 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2004-07-15 14:56:05 +0000 |
commit | 4243412aa5a9443a696cba6198a0daac3100ef3c (patch) | |
tree | d288baf81ad0ce74af97e257684d6538c78ae3d8 /winsup/cygwin/fhandler_floppy.cc | |
parent | fcedcf9488de0113b50d22fca94d6a72ed59d576 (diff) | |
download | newlib-4243412aa5a9443a696cba6198a0daac3100ef3c.zip newlib-4243412aa5a9443a696cba6198a0daac3100ef3c.tar.gz newlib-4243412aa5a9443a696cba6198a0daac3100ef3c.tar.bz2 |
* 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.
Diffstat (limited to 'winsup/cygwin/fhandler_floppy.cc')
-rw-r--r-- | winsup/cygwin/fhandler_floppy.cc | 24 |
1 files changed, 3 insertions, 21 deletions
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; |