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-08-26 07:48:37 +0400
committerChristopher Faylor <me@cgf.cx>2000-08-26 07:48:37 +0400
commitfde520bf6c1ac103d1d5904069da92acf14c9fd6 (patch)
treeb9d8ce23faa1aa20818ada40a6eca87cdde4816d /winsup/cygwin/pinfo.h
parent3c2c374555e45b55f0fdc6f1c37257bc631cf5ab (diff)
* pinfo.h (pinfo): Un-inline release.
* pinfo.cc (pinfo::release): Move here from pinfo.h. * sigproc.cc (proc_terminate): Remove bogus 'pinfo child' which caused strange destruction of random regions of memory when destructor was invoked.
Diffstat (limited to 'winsup/cygwin/pinfo.h')
-rw-r--r--winsup/cygwin/pinfo.h34
1 files changed, 13 insertions, 21 deletions
diff --git a/winsup/cygwin/pinfo.h b/winsup/cygwin/pinfo.h
index f84659813..ef8dffff2 100644
--- a/winsup/cygwin/pinfo.h
+++ b/winsup/cygwin/pinfo.h
@@ -114,37 +114,29 @@ public:
class pinfo
{
HANDLE h;
- _pinfo *child;
+ _pinfo *procinfo;
int destroy;
public:
void init (pid_t n, DWORD create = 0, HANDLE h = NULL);
- pinfo () {}
- pinfo (_pinfo *x): child (x) {}
+ pinfo (): h (NULL), procinfo (0), destroy (0) {}
+ pinfo (_pinfo *x): procinfo (x) {}
pinfo (pid_t n) {init (n);}
pinfo (pid_t n, int create) {init (n, create);}
- void release ()
- {
- if (h)
- {
- UnmapViewOfFile (child);
- ForceCloseHandle1 (h, pinfo_shared_handle);
- h = NULL;
- }
- }
+ void release ();
~pinfo ()
{
- if (destroy && child)
+ if (destroy && procinfo)
release ();
}
- _pinfo *operator -> () const {return child;}
- int operator == (pinfo *x) const {return x->child == child;}
- int operator == (pinfo &x) const {return x.child == child;}
- int operator == (void *x) const {return child == x;}
- int operator == (int x) const {return (int) child == (int) x;}
- int operator == (char *x) const {return (char *) child == x;}
- _pinfo *operator * () const {return child;}
- operator _pinfo * () const {return child;}
+ _pinfo *operator -> () const {return procinfo;}
+ int operator == (pinfo *x) const {return x->procinfo == procinfo;}
+ int operator == (pinfo &x) const {return x.procinfo == procinfo;}
+ int operator == (void *x) const {return procinfo == x;}
+ int operator == (int x) const {return (int) procinfo == (int) x;}
+ int operator == (char *x) const {return (char *) procinfo == x;}
+ _pinfo *operator * () const {return procinfo;}
+ operator _pinfo * () const {return procinfo;}
// operator bool () const {return (int) h;}
void remember () {destroy = 0; proc_subproc (PROC_ADDCHILD, (DWORD) this);}
HANDLE shared_handle () {return h;}