cygwin: fhandler_disk_file::pread: always print debug info on return

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
Corinna Vinschen 2017-11-08 13:30:42 +01:00
parent 46702f92ea
commit c983aa4879

View File

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