diff options
Diffstat (limited to 'winsup/cygwin/pinfo.cc')
-rw-r--r-- | winsup/cygwin/pinfo.cc | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/winsup/cygwin/pinfo.cc b/winsup/cygwin/pinfo.cc index ffd3d4ec6..43e3c5aae 100644 --- a/winsup/cygwin/pinfo.cc +++ b/winsup/cygwin/pinfo.cc @@ -117,14 +117,17 @@ pinfo_init (char **envp, int envc) void _pinfo::exit (UINT n, bool norecord) { - if (!norecord) - process_state = PID_EXITED; - - /* FIXME: There is a potential race between an execed process and its - parent here. I hated to add a mutex just for this, though. */ - struct rusage r; - fill_rusage (&r, hMainProc); - add_rusage (&rusage_self, &r); + if (this) + { + if (!norecord) + process_state = PID_EXITED; + + /* FIXME: There is a potential race between an execed process and its + parent here. I hated to add a mutex just for this, though. */ + struct rusage r; + fill_rusage (&r, hMainProc); + add_rusage (&rusage_self, &r); + } sigproc_printf ("Calling ExitProcess %d", n); ExitProcess (n); |