* smallprint.c (console_printf): New function.

* dcrt0.cc (dll_crt0_1): Use console_printf for debugging output.
* debug.cc (debug_mark_closed): New function.
(close_handle): Use debug_mark_closed.
* debug.h: Declare new functions.
* dtable.cc (dtable::build_fhandler): Remove unneeded extern.
* spawn.cc: Cosmetic changes.
* winsup.h: Define NO_COPY for C files, too.  Declare a global.
This commit is contained in:
Christopher Faylor
2001-08-22 17:50:22 +00:00
parent 1fdc8df95d
commit 0a047e8f32
8 changed files with 81 additions and 36 deletions

View File

@ -275,15 +275,11 @@ out:
unlock_debug ();
}
/* Close a known handle. Complain if !force and closing a known handle or
if the name of the handle being closed does not match the registered name. */
BOOL __stdcall
close_handle (const char *func, int ln, HANDLE h, const char *name, BOOL force)
bool __stdcall
debug_mark_closed (const char *func, int ln, HANDLE h, const char *name, BOOL force)
{
BOOL ret;
handle_list *hl;
lock_debug ();
if ((hl = find_handle (h)) && !force)
{
hl = hl->next;
@ -301,7 +297,7 @@ close_handle (const char *func, int ln, HANDLE h, const char *name, BOOL force)
hln->func, hln->ln, hln->name, hln->h);
system_printf (" by %s:%d(%s<%p>)", func, ln, name, h);
}
ret = CloseHandle (h);
if (hl)
{
handle_list *hnuke = hl->next;
@ -312,6 +308,23 @@ close_handle (const char *func, int ln, HANDLE h, const char *name, BOOL force)
memset (hnuke, 0, sizeof (*hnuke));
}
unlock_debug ();
return TRUE;
}
/* Close a known handle. Complain if !force and closing a known handle or
if the name of the handle being closed does not match the registered name. */
BOOL __stdcall
close_handle (const char *func, int ln, HANDLE h, const char *name, BOOL force)
{
BOOL ret;
lock_debug ();
if (!debug_mark_closed (func, ln, h, name, force))
return FALSE;
ret = CloseHandle (h);
unlock_debug ();
#if 0 /* Uncomment to see CloseHandle failures */
if (!ret)