Bug in pread/pwrite ?
Thu Mar 8 23:44:00 GMT 2007
On Fri, Mar 09, 2007 at 12:05:47AM +0100, Christophe GRENIER wrote:
>After upgrading my compiler from cygwin 1.5.17-1 to 1.5.24-2, TestDisk
>& PhotoRec, my GPL data recovery programs, were unable to read data!
Please calm down.
>I have written a little program (see attachment) to reproduce the
>problem. As administrator, run "test_pread /dev/sda".
>The program use lseek() to go the disk end, the function failed. Now
>pread will now always failed, because it ends (cf
>cygwin-1.5.24-2/newlib/libc/unix/pread.c) by an lseek to the backuped
>location. The same problem also applies to pwrite.
>I don't know if the following patch is a good idea:
Patches sent here are really supposed to be tested. You obviously
didn't test this because your proposed patch doesn't modify a function
that Cygwin actually uses.
The pread() that Cygwin does uses is in fhandler_disk_file.cc.
All of that aside, I don't see how ignoring an lseek() failure
could be considered to be a good thing.
More information about the Cygwin-patches