Skip to content

Commit

Permalink
patch from @davisp, ease the code.
Browse files Browse the repository at this point in the history
  • Loading branch information
benoitc committed Feb 25, 2011
1 parent 43dfb8f commit 7dd7b71
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions gunicorn/util.py
Expand Up @@ -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()

Expand Down

0 comments on commit 7dd7b71

Please sign in to comment.