* 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.
This commit is contained in:
@ -14,6 +14,7 @@ details. */
|
||||
#include "perthread.h"
|
||||
#include "perprocess.h"
|
||||
#include "security.h"
|
||||
#include "cygerrno.h"
|
||||
|
||||
#undef CloseHandle
|
||||
|
||||
@ -348,4 +349,12 @@ close_handle (const char *func, int ln, HANDLE h, const char *name, BOOL force)
|
||||
#endif
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* Add a handle to the linked list of known handles. */
|
||||
void __stdcall
|
||||
__set_errno (const char *func, int ln, int val)
|
||||
{
|
||||
debug_printf ("%s:%d val %d", func, ln, val);
|
||||
_impure_ptr->_errno = val;
|
||||
}
|
||||
#endif /*DEBUGGING*/
|
||||
|
Reference in New Issue
Block a user