* fhandler.cc (fhandler_base::read): Call get_readahead_into_buffer instead of
duplicating it.
This commit is contained in:
parent
a0bb355ffe
commit
5ecd1ea663
@ -1,3 +1,8 @@
|
|||||||
|
2006-07-26 Brian ford <Brian.Ford@FlightSafety.com>
|
||||||
|
|
||||||
|
* fhandler.cc (fhandler_base::read): Call get_readahead_into_buffer
|
||||||
|
instead of duplicating it.
|
||||||
|
|
||||||
2006-07-26 Corinna Vinschen <corinna@vinschen.de>
|
2006-07-26 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
* shared.cc (offsets): Define as offsets relative to cygwin_hmodule
|
* shared.cc (offsets): Define as offsets relative to cygwin_hmodule
|
||||||
|
@ -716,17 +716,7 @@ void
|
|||||||
fhandler_base::read (void *in_ptr, size_t& len)
|
fhandler_base::read (void *in_ptr, size_t& len)
|
||||||
{
|
{
|
||||||
char *ptr = (char *) in_ptr;
|
char *ptr = (char *) in_ptr;
|
||||||
ssize_t copied_chars = 0;
|
ssize_t copied_chars = get_readahead_into_buffer (ptr, len);
|
||||||
int c;
|
|
||||||
|
|
||||||
while (len)
|
|
||||||
if ((c = get_readahead ()) < 0)
|
|
||||||
break;
|
|
||||||
else
|
|
||||||
{
|
|
||||||
ptr[copied_chars++] = (unsigned char) (c & 0xff);
|
|
||||||
len--;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (copied_chars && is_slow ())
|
if (copied_chars && is_slow ())
|
||||||
{
|
{
|
||||||
@ -734,6 +724,7 @@ fhandler_base::read (void *in_ptr, size_t& len)
|
|||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
len -= copied_chars;
|
||||||
if (!len)
|
if (!len)
|
||||||
{
|
{
|
||||||
len = (size_t) copied_chars;
|
len = (size_t) copied_chars;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user