diff options
author | Christopher Faylor <me@cgf.cx> | 2013-10-24 19:26:21 +0400 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2013-10-24 19:26:21 +0400 |
commit | 4ae84b225105921c1ceef22ff541b06ba7558c11 (patch) | |
tree | e9ecdee88c2f75aca15c9bb1c5364a14bd846bed /winsup/cygwin/external.cc | |
parent | 84e7adad1da635f1f2305704c756e66936f2f1d8 (diff) |
* external.cc (fillout_pinfo): If start_time is 0, wait a while before
returning the pinfo structure.
* fhandler.cc (fhandler_base::open_setup): Convert from inline.
* fhandler.h (fhandler_base::open_setup): Declare.
* fhandler_console.cc (fhandler_console::open_setup): Always call
fhandler_base::open_setup.
* fhandler_tty.cc (fhandler_pty_slave::open_setup): Ditto.
(fhandler_pty_master::open_setup): Ditto.
Diffstat (limited to 'winsup/cygwin/external.cc')
-rw-r--r-- | winsup/cygwin/external.cc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/winsup/cygwin/external.cc b/winsup/cygwin/external.cc index 4dc87bf80..0027c5c00 100644 --- a/winsup/cygwin/external.cc +++ b/winsup/cygwin/external.cc @@ -76,6 +76,13 @@ fillout_pinfo (pid_t pid, int winpid) } else if (nextpid || p->pid == pid || (winpid && thispid == (DWORD) pid)) { + /* It is possible that this pinfo is not completely set up yet. Wait + a while if so. */ + for (int i = 0; i < 2000; i++) + if (p->start_time) + break; + else + Sleep (1); ep.ctty = (p->ctty < 0 || iscons_dev (p->ctty)) ? p->ctty : device::minor (p->ctty); ep.pid = p->pid; ep.ppid = p->ppid; |