This is the mail archive of the
cygwin-patches
mailing list for the Cygwin project.
Re: Bug in pread/pwrite ?
- From: Christopher Faylor <cgf-use-the-mailinglist-please at cygwin dot com>
- To: cygwin-patches at cygwin dot com
- Date: Thu, 8 Mar 2007 18:44:49 -0500
- Subject: Re: Bug in pread/pwrite ?
- References: <Pine.LNX.4.64.0703082349050.17686@adsl.cgsecurity.org>
- Reply-to: cygwin-patches at cygwin dot com
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.
cgf