diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2008-11-21 13:46:17 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2008-11-21 13:46:17 +0000 |
commit | 99abc9526ec0a5fa2714ee8328461a81d905a28b (patch) | |
tree | 466df3772bdb5ecb1edc87529bf8873ec854a226 /winsup | |
parent | b007725e34dc3918f25a5e8c8487d6424def7e3f (diff) | |
download | cygnal-99abc9526ec0a5fa2714ee8328461a81d905a28b.tar.gz cygnal-99abc9526ec0a5fa2714ee8328461a81d905a28b.tar.bz2 cygnal-99abc9526ec0a5fa2714ee8328461a81d905a28b.zip |
* fhandler_floppy.cc (fhandler_dev_floppy::raw_read): Drop
initialization of bytes_to_read. Set bytes_to_read to len in
non-buffered case. Call read_bytes correctly with bytes_to_read
instead of len.
Diffstat (limited to 'winsup')
-rw-r--r-- | winsup/cygwin/ChangeLog | 7 | ||||
-rw-r--r-- | winsup/cygwin/fhandler_floppy.cc | 5 |
2 files changed, 10 insertions, 2 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index d0cf692b4..31d74eed0 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,5 +1,12 @@ 2008-11-21 Corinna Vinschen <corinna@vinschen.de> + * fhandler_floppy.cc (fhandler_dev_floppy::raw_read): Drop + initialization of bytes_to_read. Set bytes_to_read to len in + non-buffered case. Call read_bytes correctly with bytes_to_read + instead of len. + +2008-11-21 Corinna Vinschen <corinna@vinschen.de> + * mmap.cc (MapView): Add NT status to debug output. 2008-11-11 Corinna Vinschen <corinna@vinschen.de> diff --git a/winsup/cygwin/fhandler_floppy.cc b/winsup/cygwin/fhandler_floppy.cc index 1357515aa..4368c5396 100644 --- a/winsup/cygwin/fhandler_floppy.cc +++ b/winsup/cygwin/fhandler_floppy.cc @@ -245,7 +245,7 @@ fhandler_dev_floppy::raw_read (void *ptr, size_t& ulen) { DWORD bytes_read = 0; DWORD read2; - DWORD bytes_to_read = 0; + DWORD bytes_to_read; int ret; size_t len = ulen; char *tgt; @@ -341,9 +341,10 @@ fhandler_dev_floppy::raw_read (void *ptr, size_t& ulen) else { _off64_t current_position = get_current_position (); + bytes_to_read = len; if (current_position + bytes_to_read >= drive_size) bytes_to_read = drive_size - current_position; - if (bytes_to_read && !read_file (p, len, &bytes_read, &ret)) + if (bytes_to_read && !read_file (p, bytes_to_read, &bytes_read, &ret)) { if (!IS_EOM (ret)) { |