* cygerrno.h (__seterrno_from_nt_status): Define. Always set Win32
error code as well as errno. Use throughout where errno is set from NT status. (set_errno): Evaluate val only once. * fhandler_disk_file.cc (fhandler_base::fstat_by_handle): Fix typo in debug output. * fhandler_mem.cc (fhandler_dev_mem::open): Rely on __seterrno_from_nt_status setting Win32 error code in debug output. * fhandler_proc.cc (format_proc_uptime): Ditto. (format_proc_stat): Ditto. * fhandler_process.cc (format_process_stat): Ditto. * sysconf.cc (sysconf): Ditto.
This commit is contained in:
@@ -1115,7 +1115,7 @@ fhandler_disk_file::mmap (caddr_t *addr, size_t len, DWORD access,
|
||||
base ? AT_ROUND_TO_PAGE : 0, protect);
|
||||
if (ret != STATUS_SUCCESS)
|
||||
{
|
||||
__seterrno_from_win_error (RtlNtStatusToDosError (ret));
|
||||
__seterrno_from_nt_status (ret);
|
||||
base = NULL;
|
||||
}
|
||||
else
|
||||
@@ -1196,7 +1196,7 @@ fhandler_disk_file::fixup_mmap_after_fork (HANDLE h, DWORD access, int flags,
|
||||
ulen, &phys, &ulen, ViewShare,
|
||||
AT_ROUND_TO_PAGE, protect);
|
||||
if (ret != STATUS_SUCCESS)
|
||||
__seterrno_from_win_error (RtlNtStatusToDosError (ret));
|
||||
__seterrno_from_nt_status (ret);
|
||||
}
|
||||
else
|
||||
base = MapViewOfFileEx (h, access, 0, offset, size, address);
|
||||
|
Reference in New Issue
Block a user