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>2002-07-14 23:15:32 +0400
committerChristopher Faylor <me@cgf.cx>2002-07-14 23:15:32 +0400
commit3d0ba393dfa79cb4a43a3a753ad64f5caaae37cb (patch)
tree8f021e010562810ef3906ea7ec554fe7f2d3543f /winsup/cygwin/debug.cc
parentf5c3d180804531dabb521513b8d9da9a6b313f06 (diff)
* dcrt0.cc (dll_crt0_1): Move debug_init call back to here. Avoid a compiler
warning. * shared.cc (memory_init): Remove debug_init call. * debug.h (handle_list): Change "clexec" to "inherited". * debug.cc: Remove a spurious declaration. (setclexec): Conditionalize away since it is currently unused. (add_handle): Use inherited field rather than clexec. (debug_fixup_after_fork_exec): Ditto. Move debugging output to delete_handle. (delete_handle): Add debugging output. * fhandler.cc (fhandler_base::set_inheritance): Don't bother setting inheritance in debugging table since the handle was never protected anyway. (fhandler_base::fork_fixup): Ditto. * exceptions.cc (debugger_command): Revert.
Diffstat (limited to 'winsup/cygwin/debug.cc')
-rw-r--r--winsup/cygwin/debug.cc20
1 files changed, 9 insertions, 11 deletions
diff --git a/winsup/cygwin/debug.cc b/winsup/cygwin/debug.cc
index 369b3908f..f918b87c0 100644
--- a/winsup/cygwin/debug.cc
+++ b/winsup/cygwin/debug.cc
@@ -173,8 +173,6 @@ threadname (DWORD tid, int lockit)
#include <stdlib.h>
#define NFREEH (sizeof (cygheap->debug.freeh) / sizeof (cygheap->debug.freeh[0]))
-void debug_init ();
-
class lock_debug
{
static muto *locker;
@@ -223,17 +221,19 @@ out:
return hl;
}
+#ifdef DEBUGGING_AND_FDS_PROTECTED
void
-setclexec (HANDLE oh, HANDLE nh, bool setit)
+setclexec (HANDLE oh, HANDLE nh, bool not_inheriting)
{
handle_list *hl = find_handle (oh);
if (hl)
{
hl = hl->next;
- hl->clexec = setit;
+ hl->inherited = !not_inheriting;
hl->h = nh;
}
}
+#endif
/* Create a new handle record */
static handle_list * __stdcall
@@ -288,11 +288,11 @@ add_handle (const char *func, int ln, HANDLE h, const char *name, bool inh)
hl->func = func;
hl->ln = ln;
hl->next = NULL;
- hl->clexec = !inh;
+ hl->inherited = inh;
hl->pid = GetCurrentProcessId ();
cygheap->debug.endh->next = hl;
cygheap->debug.endh = hl;
- debug_printf ("protecting handle '%s', clexec flag %d", hl->name, hl->clexec);
+ debug_printf ("protecting handle '%s', inherited flag %d", hl->name, hl->inherited);
return;
}
@@ -301,6 +301,7 @@ static void __stdcall
delete_handle (handle_list *hl)
{
handle_list *hnuke = hl->next;
+ debug_printf ("nuking handle '%s'", hnuke->name);
hl->next = hl->next->next;
if (hnuke->allocated)
free (hnuke);
@@ -314,13 +315,10 @@ debug_fixup_after_fork_exec ()
/* No lock needed at this point */
handle_list *hl;
for (hl = &cygheap->debug.starth; hl->next != NULL; /* nothing */)
- if (!hl->next->clexec)
+ if (hl->next->inherited)
hl = hl->next;
else
- {
- debug_printf ("nuking handle '%s'", hl->next->name);
- delete_handle (hl); // removes hl->next
- }
+ delete_handle (hl); // removes hl->next
}
static bool __stdcall