patch from @davisp, ease the code.

This commit is contained in:
benoitc 2011-02-25 08:47:46 +01:00
parent 43dfb8f0f7
commit 7dd7b71523

View File

@ -257,13 +257,13 @@ def daemonize():
http://www.svbug.com/documentation/comp.unix.programmer-FAQ/faq_2.html#SEC16
"""
if not 'GUNICORN_FD' in os.environ:
if os.fork() == 0:
os.setsid()
if os.fork():
os._exit(0)
else:
if os.fork():
os._exit(0)
os.setsid()
if os.fork():
os._exit(0)
os.umask(0)
maxfd = get_maxfd()