aboutsummaryrefslogtreecommitdiff
path: root/winsup/cygwin/fhandler_proc.cc
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2005-04-13 16:41:33 +0000
committerCorinna Vinschen <corinna@vinschen.de>2005-04-13 16:41:33 +0000
commit7460bfd32bd2680383c72d7d26ccb7776ccffb00 (patch)
treebd91f1b6551b8483b0c1278d0ece55fa65f3f4ad /winsup/cygwin/fhandler_proc.cc
parentf134945dcbf9158af7a2b36694f5362a2c616e66 (diff)
downloadnewlib-7460bfd32bd2680383c72d7d26ccb7776ccffb00.zip
newlib-7460bfd32bd2680383c72d7d26ccb7776ccffb00.tar.gz
newlib-7460bfd32bd2680383c72d7d26ccb7776ccffb00.tar.bz2
* 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.
Diffstat (limited to 'winsup/cygwin/fhandler_proc.cc')
-rw-r--r--winsup/cygwin/fhandler_proc.cc15
1 files changed, 6 insertions, 9 deletions
diff --git a/winsup/cygwin/fhandler_proc.cc b/winsup/cygwin/fhandler_proc.cc
index e4fc918..2086939 100644
--- a/winsup/cygwin/fhandler_proc.cc
+++ b/winsup/cygwin/fhandler_proc.cc
@@ -477,9 +477,8 @@ format_proc_uptime (char *destbuf, size_t maxsize)
}
else if (ret != STATUS_SUCCESS)
{
- __seterrno_from_win_error (RtlNtStatusToDosError (ret));
- debug_printf("NtQuerySystemInformation: ret %d, Dos(ret) %d",
- ret, RtlNtStatusToDosError (ret));
+ __seterrno_from_nt_status (ret);
+ debug_printf("NtQuerySystemInformation: ret %d, Dos(ret) %E", ret);
return 0;
}
}
@@ -514,9 +513,8 @@ format_proc_stat (char *destbuf, size_t maxsize)
(PVOID) &sbi, sizeof sbi, NULL))
!= STATUS_SUCCESS)
{
- __seterrno_from_win_error (RtlNtStatusToDosError (ret));
- debug_printf ("NtQuerySystemInformation: ret %d, Dos(ret) %d",
- ret, RtlNtStatusToDosError (ret));
+ __seterrno_from_nt_status (ret);
+ debug_printf ("NtQuerySystemInformation: ret %d, Dos(ret) %E", ret);
sbi.NumberProcessors = 1;
}
@@ -556,9 +554,8 @@ format_proc_stat (char *destbuf, size_t maxsize)
sizeof stodi, NULL);
if (ret != STATUS_SUCCESS)
{
- __seterrno_from_win_error (RtlNtStatusToDosError (ret));
- debug_printf("NtQuerySystemInformation: ret %d, Dos(ret) %d",
- ret, RtlNtStatusToDosError (ret));
+ __seterrno_from_nt_status (ret);
+ debug_printf("NtQuerySystemInformation: ret %d, Dos(ret) %E", ret);
return 0;
}
pages_in = spi.PagesRead;