* fhandler_floppy.cc (fhandler_dev_floppy::raw_read): Keep track of
current position in non-buffered case, too.
This commit is contained in:
parent
2768ae50dd
commit
3059d18288
|
@ -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
|
||||||
|
|
|
@ -338,20 +338,26 @@ fhandler_dev_floppy::raw_read (void *ptr, size_t& ulen)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (!read_file (p, len, &bytes_read, &ret))
|
else
|
||||||
{
|
{
|
||||||
if (!IS_EOM (ret))
|
_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))
|
||||||
{
|
{
|
||||||
__seterrno ();
|
if (!IS_EOM (ret))
|
||||||
goto err;
|
{
|
||||||
}
|
__seterrno ();
|
||||||
if (bytes_read)
|
goto err;
|
||||||
eom_detected (true);
|
}
|
||||||
else
|
if (bytes_read)
|
||||||
{
|
eom_detected (true);
|
||||||
debug_printf ("return -1, set errno to ENOSPC");
|
else
|
||||||
set_errno (ENOSPC);
|
{
|
||||||
goto err;
|
debug_printf ("return -1, set errno to ENOSPC");
|
||||||
|
set_errno (ENOSPC);
|
||||||
|
goto err;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue