* dcrt0.cc (dll_crt0_0): Remove myself settings.

* fork.cc (fork): Set myself process_state
* pinfo.cc (pinfo_init): Ditto.
(pinfo::thisproc): Make sure any sendsig setting is correctly copied.
* pinfo.h: Update copyright.  Remove unused code.
This commit is contained in:
Christopher Faylor 2010-09-01 21:06:36 +00:00
parent b9874a0c14
commit fc0e5071bc
5 changed files with 17 additions and 6 deletions

View File

@ -1,3 +1,11 @@
2010-09-01 Christopher Faylor <me+cygwin@cgf.cx>
* dcrt0.cc (dll_crt0_0): Remove myself settings.
* fork.cc (fork): Set myself process_state
* pinfo.cc (pinfo_init): Ditto.
(pinfo::thisproc): Make sure any sendsig setting is correctly copied.
* pinfo.h: Update copyright. Remove unused code.
2010-09-01 Christopher Faylor <me+cygwin@cgf.cx> 2010-09-01 Christopher Faylor <me+cygwin@cgf.cx>
* cygthread.cc (cygthread::create): Fix incorrect use of name rather * cygthread.cc (cygthread::create): Fix incorrect use of name rather

View File

@ -715,9 +715,6 @@ dll_crt0_0 ()
GetCurrentProcess (), &hMainThread, GetCurrentProcess (), &hMainThread,
0, false, DUPLICATE_SAME_ACCESS); 0, false, DUPLICATE_SAME_ACCESS);
myself->process_state |= PID_ACTIVE;
myself->process_state &= ~PID_INITIALIZING;
OpenProcessToken (GetCurrentProcess (), MAXIMUM_ALLOWED, &hProcToken); OpenProcessToken (GetCurrentProcess (), MAXIMUM_ALLOWED, &hProcToken);
set_cygwin_privileges (hProcToken); set_cygwin_privileges (hProcToken);

View File

@ -619,7 +619,10 @@ fork ()
MALLOC_CHECK; MALLOC_CHECK;
if (ischild) if (ischild)
/* nothing to do */; {
myself->process_state |= PID_ACTIVE;
myself->process_state &= ~(PID_INITIALIZING | PID_EXITED);
}
else if (res < 0) else if (res < 0)
{ {
if (!grouped.error) if (!grouped.error)

View File

@ -62,6 +62,7 @@ pinfo::thisproc (HANDLE h)
init (cygheap->pid, PID_IN_USE, h ?: INVALID_HANDLE_VALUE); init (cygheap->pid, PID_IN_USE, h ?: INVALID_HANDLE_VALUE);
procinfo->process_state |= PID_IN_USE; procinfo->process_state |= PID_IN_USE;
procinfo->dwProcessId = myself_initial.pid; procinfo->dwProcessId = myself_initial.pid;
procinfo->sendsig = myself_initial.sendsig;
wcscpy (procinfo->progname, myself_initial.progname); wcscpy (procinfo->progname, myself_initial.progname);
strace.hello (); strace.hello ();
debug_printf ("myself->dwProcessId %u", procinfo->dwProcessId); debug_printf ("myself->dwProcessId %u", procinfo->dwProcessId);
@ -109,6 +110,8 @@ pinfo_init (char **envp, int envc)
debug_printf ("Set nice to %d", myself->nice); debug_printf ("Set nice to %d", myself->nice);
} }
myself->process_state |= PID_ACTIVE;
myself->process_state &= ~(PID_INITIALIZING | PID_EXITED);
debug_printf ("pid %d, pgid %d", myself->pid, myself->pgid); debug_printf ("pid %d, pgid %d", myself->pid, myself->pgid);
} }

View File

@ -1,6 +1,7 @@
/* pinfo.h: process table info /* pinfo.h: process table info
Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Red Hat, Inc. Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
Red Hat, Inc.
This file is part of Cygwin. This file is part of Cygwin.
@ -165,7 +166,6 @@ public:
int operator == (char *x) const {return (char *) procinfo == x;} int operator == (char *x) const {return (char *) procinfo == x;}
_pinfo *operator * () const {return procinfo;} _pinfo *operator * () const {return procinfo;}
operator _pinfo * () const {return procinfo;} operator _pinfo * () const {return procinfo;}
// operator bool () const {return (int) h;}
void preserve () { destroy = false; } void preserve () { destroy = false; }
#ifndef _SIGPROC_H #ifndef _SIGPROC_H
int remember () {system_printf ("remember is not here"); return 0;} int remember () {system_printf ("remember is not here"); return 0;}