Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2001-10-16 07:31:50 +0400
committerChristopher Faylor <me@cgf.cx>2001-10-16 07:31:50 +0400
commit0f4db8cbe03453c0715aff20b074816d455847b4 (patch)
treef25bad6474738ae7b1eb8f60b4b7497c66e5855c /winsup/cygwin/debug.cc
parentdf63bd490a526af2d68f391f703abe8b54a502db (diff)
* 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.
Diffstat (limited to 'winsup/cygwin/debug.cc')
-rw-r--r--winsup/cygwin/debug.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/winsup/cygwin/debug.cc b/winsup/cygwin/debug.cc
index e8293b91f..6de0757ab 100644
--- a/winsup/cygwin/debug.cc
+++ b/winsup/cygwin/debug.cc
@@ -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*/