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>2002-08-19 18:59:27 +0400
committerChristopher Faylor <me@cgf.cx>2002-08-19 18:59:27 +0400
commit3bacc423cf1c295ba2abe7d4a39add6752cac225 (patch)
tree3ffeec9a89443033f29450ded812f186d84987a3 /winsup/cygwin
parent34f72894755ffb134d011d2a3817931c915ac47e (diff)
* pinfo.h (pinfo::remember): Arrange for destructor call if proc_subproc
returns error. * sigproc.cc (zombies): Store 1 + total zombies since proc_subproc uses NZOMBIES element.
Diffstat (limited to 'winsup/cygwin')
-rw-r--r--winsup/cygwin/ChangeLog7
-rw-r--r--winsup/cygwin/pinfo.h13
-rw-r--r--winsup/cygwin/sigproc.cc2
3 files changed, 17 insertions, 5 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index b79a00d97..315ac085d 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,10 @@
+2002-08-19 Christopher Faylor <cgf@redhat.com>
+
+ * pinfo.h (pinfo::remember): Arrange for destructor call if
+ proc_subproc returns error.
+ * sigproc.cc (zombies): Store 1 + total zombies since proc_subproc uses
+ NZOMBIES element.
+
2002-08-19 Corinna Vinschen <corinna@vinschen.de>
* pwdgrp.h (pwdgrp_read::pwdgrp_read): Remove.
diff --git a/winsup/cygwin/pinfo.h b/winsup/cygwin/pinfo.h
index 8a090cfd9..dcb814bcc 100644
--- a/winsup/cygwin/pinfo.h
+++ b/winsup/cygwin/pinfo.h
@@ -131,7 +131,7 @@ class pinfo
{
HANDLE h;
_pinfo *procinfo;
- int destroy;
+ bool destroy;
public:
void init (pid_t n, DWORD create = 0, HANDLE h = NULL) __attribute__ ((regparm(3)));
pinfo () {}
@@ -154,10 +154,15 @@ public:
_pinfo *operator * () const {return procinfo;}
operator _pinfo * () const {return procinfo;}
// operator bool () const {return (int) h;}
-#ifdef _SIGPROC_H
- int remember () {destroy = 0; return proc_subproc (PROC_ADDCHILD, (DWORD) this);}
-#else
+#ifndef _SIGPROC_H
int remember () {system_printf ("remember is not here"); return 0;}
+#else
+ int remember ()
+ {
+ int res = proc_subproc (PROC_ADDCHILD, (DWORD) this);
+ destroy = res ? false : true;
+ return res;
+ }
#endif
HANDLE shared_handle () {return h;}
};
diff --git a/winsup/cygwin/sigproc.cc b/winsup/cygwin/sigproc.cc
index b43057e1c..8509ff8c4 100644
--- a/winsup/cygwin/sigproc.cc
+++ b/winsup/cygwin/sigproc.cc
@@ -107,7 +107,7 @@ Static HANDLE events[PSIZE + 1]; // All my children's handles++
#define hchildren (events + 1) // Where the children handles begin
Static char cpchildren[PSIZE * sizeof (pinfo)]; // All my children info
Static int nchildren; // Number of active children
-Static char czombies[NZOMBIES * sizeof (pinfo)]; // All my deceased children info
+Static char czombies[(NZOMBIES + 1) * sizeof (pinfo)]; // All my deceased children info
Static int nzombies; // Number of deceased children
#define pchildren ((pinfo *) cpchildren)