public inbox for cygwin-cvs@sourceware.org
help / color / mirror / Atom feed
* [newlib-cygwin] cygwin: fhandler_disk_file::pread: always print debug info on return
@ 2017-11-08 12:32 Corinna Vinschen
  0 siblings, 0 replies; only message in thread
From: Corinna Vinschen @ 2017-11-08 12:32 UTC (permalink / raw)
  To: cygwin-cvs

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=c983aa48798dc7adc165862de4b89a6e49b97bdd

commit c983aa48798dc7adc165862de4b89a6e49b97bdd
Author: Corinna Vinschen <corinna@vinschen.de>
Date:   Wed Nov 8 13:30:42 2017 +0100

    cygwin: fhandler_disk_file::pread: always print debug info on return
    
    Signed-off-by: Corinna Vinschen <corinna@vinschen.de>

Diff:
---
 winsup/cygwin/fhandler_disk_file.cc | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/winsup/cygwin/fhandler_disk_file.cc b/winsup/cygwin/fhandler_disk_file.cc
index 2e4cf49..0b99c49 100644
--- a/winsup/cygwin/fhandler_disk_file.cc
+++ b/winsup/cygwin/fhandler_disk_file.cc
@@ -1541,14 +1541,20 @@ fhandler_disk_file::pread (void *buf, size_t count, off_t offset)
 	  if (status == (NTSTATUS) STATUS_ACCESS_VIOLATION)
 	    {
 	      if (is_at_eof (prw_handle))
-		return 0;
+		{
+		  res = 0;
+		  goto out;
+		}
 	      switch (mmap_is_attached_or_noreserve (buf, count))
 		{
 		case MMAP_NORESERVE_COMMITED:
 		  status = NtReadFile (prw_handle, NULL, NULL, NULL, &io,
 				       buf, count, &off, NULL);
 		  if (NT_SUCCESS (status))
-		    return io.Information;
+		    {
+		      res = io.Information;
+		      goto out;
+		    }
 		  break;
 		case MMAP_RAISE_SIGBUS:
 		  raise (SIGBUS);
@@ -1579,6 +1585,7 @@ non_atomic:
 	    res = -1;
 	}
     }
+out:
   debug_printf ("%d = pread(%p, %ld, %D)\n", res, buf, count, offset);
   return res;
 }


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-11-08 12:32 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-08 12:32 [newlib-cygwin] cygwin: fhandler_disk_file::pread: always print debug info on return Corinna Vinschen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).