* fhandler_floppy.cc (fhandler_dev_floppy::raw_read): Keep track of

current position in non-buffered case, too.
This commit is contained in:
Corinna Vinschen 2008-10-09 12:41:52 +00:00
parent 2768ae50dd
commit 3059d18288
2 changed files with 23 additions and 12 deletions

View File

@ -1,3 +1,8 @@
2008-10-09 Corinna Vinschen <corinna@vinschen.de>
* fhandler_floppy.cc (fhandler_dev_floppy::raw_read): Keep track of
current position in non-buffered case, too.
2008-10-09 Corinna Vinschen <corinna@vinschen.de> 2008-10-09 Corinna Vinschen <corinna@vinschen.de>
* grp.cc (pwdgrp::read_group): Generate more speaking group name * grp.cc (pwdgrp::read_group): Generate more speaking group name

View File

@ -338,7 +338,12 @@ fhandler_dev_floppy::raw_read (void *ptr, size_t& ulen)
} }
} }
} }
else if (!read_file (p, len, &bytes_read, &ret)) else
{
_off64_t current_position = get_current_position ();
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 (!IS_EOM (ret)) if (!IS_EOM (ret))
{ {
@ -354,6 +359,7 @@ fhandler_dev_floppy::raw_read (void *ptr, size_t& ulen)
goto err; goto err;
} }
} }
}
ulen = (size_t) bytes_read; ulen = (size_t) bytes_read;
return; return;