From 7cdcd90ca146cd1322051385d92114b9b927776b Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Fri, 16 Apr 2010 15:42:29 +0000 Subject: * cygerrno.h (seterrno_from_nt_status): Declare. (__seterrno_from_nt_status): Call seterrno_from_nt_status. * errno.cc (seterrno_from_win_error): Set errno without calling set_errno to avoid packing strace output with errno messages. (seterrno_from_nt_status): New function to print NT status as well as resulting Windows error. --- winsup/cygwin/cygerrno.h | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'winsup/cygwin/cygerrno.h') diff --git a/winsup/cygwin/cygerrno.h b/winsup/cygwin/cygerrno.h index e6ec7c556..e1a1af07d 100644 --- a/winsup/cygwin/cygerrno.h +++ b/winsup/cygwin/cygerrno.h @@ -1,6 +1,6 @@ /* cygerrno.h: main Cygwin header file. - Copyright 2000, 2001, 2002, 2003, 2004 Red Hat, Inc. + Copyright 2000, 2001, 2002, 2003, 2004, 2010 Red Hat, Inc. This file is part of Cygwin. @@ -13,17 +13,13 @@ details. */ #include void __stdcall seterrno_from_win_error (const char *file, int line, DWORD code) __attribute__ ((regparm(3))); +void __stdcall seterrno_from_nt_status (const char *file, int line, NTSTATUS status) __attribute__ ((regparm(3))); void __stdcall seterrno (const char *, int line) __attribute__ ((regparm(2))); int __stdcall geterrno_from_win_error (DWORD code = GetLastError (), int deferrno = 13 /*EACCESS*/) __attribute__ ((regparm(2))); #define __seterrno() seterrno (__FILE__, __LINE__) #define __seterrno_from_win_error(val) seterrno_from_win_error (__FILE__, __LINE__, val) -#define __seterrno_from_nt_status(status) \ - ({ \ - DWORD winerr = RtlNtStatusToDosError (status); \ - SetLastError (winerr); \ - __seterrno_from_win_error (winerr); \ - }) +#define __seterrno_from_nt_status(status) seterrno_from_nt_status (__FILE__, __LINE__, status) inline int __set_errno (const char *fn, int ln, int val) -- cgit v1.2.3