+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>
* shared.cc (offsets): Define as offsets relative to cygwin_hmodule
fhandler_base::read (void *in_ptr, size_t& len)
{
char *ptr = (char *) in_ptr;
- ssize_t copied_chars = 0;
- int c;
-
- while (len)
- if ((c = get_readahead ()) < 0)
- break;
- else
- {
- ptr[copied_chars++] = (unsigned char) (c & 0xff);
- len--;
- }
+ ssize_t copied_chars = get_readahead_into_buffer (ptr, len);
if (copied_chars && is_slow ())
{
goto out;
}
+ len -= copied_chars;
if (!len)
{
len = (size_t) copied_chars;