mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-01-16 11:31:00 +08:00
eb4bfe4621
When reading/writing block devices, Cygwin emulates Linux, providing a byte-exact file position, albeit the underlying device drivers don't. Unfortunately this only worked correctly for reading. The raw_write method failed to revalidate the buffer after the read-modify-write cycle in case len is not a multiple of the sector length. This in turn resulted in lseek reporting a wrong file pointer. Also, fix a condition for invalidating the buffer after writing from a remaining read buffer. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. Cygwin documentation is available on the net at https://cygwin.com You might especially be interested in https://cygwin.com/faq/faq.html#faq.programming.building-cygwin