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

Corinna Vinschen
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/ b/winsup/cygwin/               index bc8fead..525cb32 100644                                                                        --- a/winsup/cygwin/                                                            +++ b/winsup/cygwin/                                                            @@ -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="" 0001-*

That should work.


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: <>

More information about the Cygwin-patches mailing list