[Zope-Checkins] CVS: StandaloneZODB/zdaemon - Daemon.py:1.7

Jeremy Hylton jeremy@zope.com
Thu, 25 Apr 2002 15:41:50 -0400


Update of /cvs-repository/StandaloneZODB/zdaemon
In directory cvs.zope.org:/tmp/cvs-serv8817

Modified Files:
	Daemon.py 
Log Message:
Use the os module instead of the posix module.

This make some of the code work on Windows, and will allow an import
to succeed.  BUT setsid() still won't work on Windows, so this isn't a
complete fix.


=== StandaloneZODB/zdaemon/Daemon.py 1.6 => 1.7 ===
 ##############################################################################
 
-import os, sys, time, signal, posix
+import os, sys, time, signal
 
 from ZDaemonLogging import pstamp
 import Heartbeat
@@ -56,10 +56,10 @@
         pid = os.fork()
         if pid:
             sys.exit(0)
-        posix.close(0); sys.stdin  = open('/dev/null')
-        posix.close(1); sys.stdout = open('/dev/null','w')
-        posix.close(2); sys.stderr = open('/dev/null','w')
-        posix.setsid()
+        os.close(0); sys.stdin  = open('/dev/null')
+        os.close(1); sys.stdout = open('/dev/null','w')
+        os.close(2); sys.stderr = open('/dev/null','w')
+        os.setsid()
 
     while 1: