From f8f9b12e6c3641678f931147b3f6f2c69c72201d Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Wed, 25 Oct 2000 03:54:50 +0000 Subject: * dcrt0.cc (do_exit): Don't bother looking for pgrp children to send SIGHUP if process has never created any children. * fork.cc (fork): Set flag indicating that there is another process with our process group. * spawn.cc (spawn_guts): Ditto. * pinfo.h (set_has_pgid_children): New methods for setting when process has children in its process group. * syscalls.cc (setpgid): Clear has_gid_children if pgid changes. --- winsup/cygwin/pinfo.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'winsup/cygwin/pinfo.h') diff --git a/winsup/cygwin/pinfo.h b/winsup/cygwin/pinfo.h index 067ef6104..e9d54cf65 100644 --- a/winsup/cygwin/pinfo.h +++ b/winsup/cygwin/pinfo.h @@ -70,6 +70,7 @@ public: pid_t sid; /* Session ID */ int ctty; /* Control tty */ mode_t umask; + bool has_pgid_children;/* True if we've forked or spawned children with our GID. */ char username[MAX_USER_NAME]; /* user's name */ /* Extendend user information. @@ -106,6 +107,14 @@ public: void exit (UINT n, bool norecord = 0) __attribute__ ((noreturn, regparm(2))); + inline void set_has_pgid_children () + { + if (pgid == pid) + has_pgid_children = 1; + } + + inline void set_has_pgid_children (bool val) {has_pgid_children = val;} + inline struct sigaction& getsig (int sig) { return thread2signal ? thread2signal->sigs[sig] : sigs[sig]; @@ -158,7 +167,7 @@ public: if (destroy && procinfo) release (); } - + _pinfo *operator -> () const {return procinfo;} int operator == (pinfo *x) const {return x->procinfo == procinfo;} int operator == (pinfo &x) const {return x.procinfo == procinfo;} -- cgit v1.2.3