* debug.cc (add_handle): Issue warning on attempts to add the same handle more
than once. * fhandler_tty.cc (fhandler_tty_slave::open): Protect some handles. (fhandler_tty_common::close): Use proper name when closing handles. (fhandler_pty_master::close): Don't close to_slave or from_slave since they've already been closed earlier in the function. * sigproc.cc (proc_subproc): Don't protect vchild->hProcess. Expect that the caller will do this, instead. * tty.cc (tty_list::terminate): Use proper name when closing handles. (tty::make_pipes): Protect some handles.
This commit is contained in:
@ -246,8 +246,14 @@ add_handle (const char *func, int ln, HANDLE h, const char *name)
|
||||
handle_list *hl;
|
||||
lock_debug ();
|
||||
|
||||
if (find_handle (h))
|
||||
goto out; /* Already did this once */
|
||||
if ((hl = find_handle (h)))
|
||||
{
|
||||
system_printf ("%s:%d - multiple attempts to add handle %s<%p>", func,
|
||||
ln, name, h);
|
||||
system_printf (" previously allocated by %s:%d(%s<%p>)",
|
||||
hl->func, hl->ln, hl->name, hl->h);
|
||||
goto out; /* Already did this once */
|
||||
}
|
||||
|
||||
if ((hl = newh()) == NULL)
|
||||
{
|
||||
|
Reference in New Issue
Block a user