[Zope-Checkins] CVS: Zope/lib/python/zdaemon - Daemon.py:1.11.4.4

Chris McDonough chrism@zope.com
Sat, 26 Oct 2002 15:51:54 -0400


Update of /cvs-repository/Zope/lib/python/zdaemon
In directory cvs.zope.org:/tmp/cvs-serv31373/lib/python/zdaemon

Modified Files:
      Tag: chrism-install-branch
	Daemon.py 
Log Message:
Merge with HEAD.  Again, sorry for the spew (what's left of it... someone seems to have filtered some of this branch's checkins out).


=== Zope/lib/python/zdaemon/Daemon.py 1.11.4.3 => 1.11.4.4 ===
--- Zope/lib/python/zdaemon/Daemon.py:1.11.4.3	Wed Oct  9 00:57:33 2002
+++ Zope/lib/python/zdaemon/Daemon.py	Sat Oct 26 15:51:53 2002
@@ -114,18 +114,12 @@
         signum = os.WTERMSIG(s)
         signame = get_signal_name(signum)
         msg = "terminated by signal %s(%s)" % (signame, signum)
-        # We'd like to report whether a core file
-        # was produced, but there isn't a standard
-        # way to check.  It seems that some
-        # (many?) Unixes use bit 0x80 in the wait
-        # status, but how to tell?  A simple
-        # alternative is to assume that no core
-        # file was produced if the wait status is
-        # exactly equal to the signal.  Otherwise,
-        # there might be a core file and it's
-        # useful to print the wait status.
-        if signum != s:
-            msg += ", wait status: %s" % signum
+        if hasattr(os, 'WCOREDUMP'):
+            iscore = os.WCOREDUMP(s)
+        else:
+            iscore = s & 0x80
+        if iscore:
+            msg += " (core dumped)"
     else:
         # XXX what should we do here?
         signum = os.WSTOPSIG(s)