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>2013-12-18 08:28:46 +0400
committerChristopher Faylor <me@cgf.cx>2013-12-18 08:28:46 +0400
commite9da9dfb94b580edb617562c7681b9646fbc7255 (patch)
treee571e52aca63c402cb2b11940a706fc1dee7ed1a /winsup/cygwin/pinfo.cc
parent13621d2ef873ae1d7203592798803d378a2d3fa4 (diff)
* autoload.cc (timeBeginPeriod): Autoload.
* dcrt0.cc (dll_crt0_1): Use timeBeginPeriod to set default resolution to 1 ms. * pinfo.cc (pinfo::thisproc): Set ppid for redirected _pinfo blocks too. (pinfo::init): Avoid using VirtualQuery. Just rely on the assumption that procinfo will be populated. * pinfo.h (_pinfo::ppid): Move into redirected block.
Diffstat (limited to 'winsup/cygwin/pinfo.cc')
-rw-r--r--winsup/cygwin/pinfo.cc12
1 files changed, 4 insertions, 8 deletions
diff --git a/winsup/cygwin/pinfo.cc b/winsup/cygwin/pinfo.cc
index 8f9986fc2..a22a9d7b3 100644
--- a/winsup/cygwin/pinfo.cc
+++ b/winsup/cygwin/pinfo.cc
@@ -77,6 +77,7 @@ pinfo::thisproc (HANDLE h)
myself_identity.init (cygwin_pid (procinfo->dwProcessId), PID_EXECED, NULL);
procinfo->exec_sendsig = NULL;
procinfo->exec_dwProcessId = 0;
+ myself_identity->ppid = procinfo->pid;
}
}
@@ -317,14 +318,9 @@ pinfo::init (pid_t n, DWORD flag, HANDLE h0)
If the block has been allocated with PINFO_REDIR_SIZE but not yet
updated with a PID_EXECED state then we'll retry. */
if (!created && !(flag & PID_NEW))
- {
- MEMORY_BASIC_INFORMATION mbi;
- for (int i = 0; i < 1000 && !procinfo->ppid; i++)
- Sleep (0);
- if (procinfo->exists () && VirtualQuery (procinfo, &mbi, sizeof (mbi))
- && mbi.RegionSize < sizeof (_pinfo))
- goto loop;
- }
+ /* If not populated, wait 2 seconds for procinfo to become populated */
+ for (int i = 0; i < 2000 && !procinfo->ppid; i++)
+ Sleep (1);
if (!created && createit && (procinfo->process_state & PID_REAPED))
{