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>2000-10-21 08:53:49 +0400
committerChristopher Faylor <me@cgf.cx>2000-10-21 08:53:49 +0400
commitb0de2aa284ccb58f1c8f8e0a598701b51ab5b742 (patch)
treee9de21c89264e0f9987ab88dab845446c1b4bc45 /winsup/cygwin/pinfo.cc
parente9921bcbaa37b9c3df39ef1d8182d56a9db3cb11 (diff)
* fhandler.h (fhandler_console): Remove tcsetpgrp.
* fhandler_console.cc (fhandler_console::tcsetpgrp): Eliminate. * fork.cc (fork_parent): Avoid returning same pid twice in a row regardless of OS. * pinfo.cc (pinfo::init): Rename create argument to flags and treat it as such. * signal.cc (set_sigcatchers): New function. (signal): Use set_sigcatchers to increment or decrement sigcatcher tracker. (sigaction): Ditto. Add debugging output. * spawn.cc (spawn_guts): Always quote first argv[0] argument when it's a COMSPEC shell.
Diffstat (limited to 'winsup/cygwin/pinfo.cc')
-rw-r--r--winsup/cygwin/pinfo.cc15
1 files changed, 8 insertions, 7 deletions
diff --git a/winsup/cygwin/pinfo.cc b/winsup/cygwin/pinfo.cc
index e1a195c7b..099e961e1 100644
--- a/winsup/cygwin/pinfo.cc
+++ b/winsup/cygwin/pinfo.cc
@@ -134,7 +134,7 @@ _pinfo::exit (UINT n, bool norecord)
}
void
-pinfo::init (pid_t n, DWORD create, HANDLE in_h)
+pinfo::init (pid_t n, DWORD flag, HANDLE in_h)
{
if (n == myself->pid)
{
@@ -144,6 +144,7 @@ pinfo::init (pid_t n, DWORD create, HANDLE in_h)
return;
}
+ int createit = flag & PID_IN_USE;
for (int i = 0; i < 10; i++)
{
int created;
@@ -151,7 +152,7 @@ pinfo::init (pid_t n, DWORD create, HANDLE in_h)
__small_sprintf (mapname, "cygpid.%x", n);
int mapsize;
- if (create & PID_EXECED)
+ if (flag & PID_EXECED)
mapsize = PINFO_REDIR_SIZE;
else
mapsize = sizeof (_pinfo);
@@ -161,7 +162,7 @@ pinfo::init (pid_t n, DWORD create, HANDLE in_h)
h = in_h;
created = 0;
}
- else if (!create)
+ else if (!createit)
{
h = OpenFileMappingA (FILE_MAP_READ | FILE_MAP_WRITE, FALSE, mapname);
created = 0;
@@ -175,7 +176,7 @@ pinfo::init (pid_t n, DWORD create, HANDLE in_h)
if (!h)
{
- if (create)
+ if (createit)
__seterrno ();
procinfo = NULL;
return;
@@ -184,7 +185,7 @@ pinfo::init (pid_t n, DWORD create, HANDLE in_h)
procinfo = (_pinfo *) MapViewOfFile (h, FILE_MAP_READ | FILE_MAP_WRITE, 0, 0, 0);
ProtectHandle1 (h, pinfo_shared_handle);
- if ((procinfo->process_state & PID_INITIALIZING) && (create & PID_NOREDIR))
+ if ((procinfo->process_state & PID_INITIALIZING) && (flag & PID_NOREDIR))
{
release ();
set_errno (ENOENT);
@@ -208,7 +209,7 @@ pinfo::init (pid_t n, DWORD create, HANDLE in_h)
should only be a brief occurrence, so rather than introduce some kind
of locking mechanism, just loop. FIXME: I'm sure I'll regret doing it
this way at some point. */
- if (i < 9 && !created && create && (procinfo->process_state & PID_EXITED))
+ if (i < 9 && !created && createit && (procinfo->process_state & PID_EXITED))
{
Sleep (5);
release ();
@@ -217,7 +218,7 @@ pinfo::init (pid_t n, DWORD create, HANDLE in_h)
if (!created)
/* nothing */;
- else if (!(create & PID_EXECED))
+ else if (!(flag & PID_EXECED))
procinfo->pid = n;
else
{