Cygwin: console: Fix deadlock at calling fork().

- Calling fork() on console occasionally falls into deadlock. The reason
  is not clear, however, this patch fixes this problem anyway.
This commit is contained in:
Takashi Yano 2019-08-12 22:46:23 +09:00 committed by Corinna Vinschen
parent 744b90c996
commit 92e2c1ad9d
1 changed files with 6 additions and 2 deletions

View File

@ -168,8 +168,12 @@ fhandler_console::set_unit ()
if (created)
con.owner = getpid ();
}
if (!created && shared_console_info && kill (con.owner, 0) == -1)
con.owner = getpid ();
if (!created && shared_console_info)
{
pinfo p (con.owner);
if (!p)
con.owner = getpid ();
}
dev ().parse (devset);
if (devset != FH_ERROR)