From 0f4db8cbe03453c0715aff20b074816d455847b4 Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Tue, 16 Oct 2001 03:31:50 +0000 Subject: * cygerrno.h (set_errno): Define more informative version of this function for debugging. (__set_errno): Declare when DEBUGGING. * cygheap.h (cygheap_fdget::cygheap_fdget): Add a flag to control when errno is set. * debug.cc (__set_errno): New function. * fcntl.cc (_fcntl): Fix so that correct fd is used for second argument to dup2. * syscalls.cc (_cygwin_istext_for_stdio): Don't set errno here when using cygheap_fdget. --- winsup/cygwin/cygerrno.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'winsup/cygwin/cygerrno.h') diff --git a/winsup/cygwin/cygerrno.h b/winsup/cygwin/cygerrno.h index dd40819b9..ff4e90489 100644 --- a/winsup/cygwin/cygerrno.h +++ b/winsup/cygwin/cygerrno.h @@ -15,7 +15,12 @@ int __stdcall geterrno_from_win_error (DWORD code, int deferrno) __attribute__ ( #define __seterrno() seterrno (__FILE__, __LINE__) #define __seterrno_from_win_error(val) seterrno_from_win_error (__FILE__, __LINE__, val) +#ifndef DEBUGGING #define set_errno(val) (_impure_ptr->_errno = (val)) +#else +void __stdcall __set_errno (const char *ln, int ln, int val) __attribute ((regparm(3))); +#define set_errno(val) __set_errno (__PRETTY_FUNCTION__, __LINE__, (val)) +#endif #define get_errno() (_impure_ptr->_errno) extern "C" void __stdcall set_sig_errno (int e); -- cgit v1.2.3