[Zope-Checkins] CVS: ZODB3/zdaemon - Daemon.py:1.14

Guido van Rossum guido@python.org
Fri, 11 Oct 2002 09:29:56 -0400


Update of /cvs-repository/ZODB3/zdaemon
In directory cvs.zope.org:/tmp/cvs-serv8342

Modified Files:
	Daemon.py 
Log Message:
Don't be so wimpy about testing for core dumps.  It's s & 0x80, except
when os.WCOREDUMP exists.


=== ZODB3/zdaemon/Daemon.py 1.13 => 1.14 ===
--- ZODB3/zdaemon/Daemon.py:1.13	Tue Oct  8 20:32:50 2002
+++ ZODB3/zdaemon/Daemon.py	Fri Oct 11 09:29:55 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)