PATCH: pread() return non-zero if read beyond end of file

Corinna Vinschen corinna-cygwin@cygwin.com
Tue Nov 7 10:33:00 GMT 2017


On Nov  6 21:54, Xiaofeng Liu via cygwin-patches wrote:
>  try again, after saving the diff in linux first.
> git diff                                                                                             diff --git a/winsup/cygwin/fhandler_disk_file.cc b/winsup/cygwin/fhandler_disk_file.cc               index bc8fead..525cb32 100644                                                                        --- a/winsup/cygwin/fhandler_disk_file.cc                                                            +++ b/winsup/cygwin/fhandler_disk_file.cc                                                            @@ -1525,6 +1525,7 @@ fhandler_disk_file::pread (void *buf, size_t count, off_t offset)       IO_STATUS_BLOCK io;                                                                                  LARGE_INTEGER off = { QuadPart:offset };                                                      
> +      memset(&io, 0, sizeof(io));                                                                          if (!prw_handle && prw_open (false))                                                                  goto non_atomic;                                                                                    status = NtReadFile (prw_handle, NULL, NULL, NULL, &io, buf, count,                           

Didn't help.  Here's an idea:

`git commit' the patch with a nice log message and call

  git format-patch -1

Then send the generated patch file called 0001-something.patch with

  git send-email --to="cygwin-patches@cygwin.com" 0001-*

That should work.


Thanks,
Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin-patches/attachments/20171107/55f6fe03/attachment.sig>


More information about the Cygwin-patches mailing list