From 2e2432c91b8eeee309999b2041172368f2528c1e Mon Sep 17 00:00:00 2001 From: benoitc Date: Mon, 22 Apr 2013 19:05:31 +0200 Subject: [PATCH] Revert "add GUNICORN_INHERIT_FDS environment variable support" This reverts commit c9fcb25f51db9ae67f9585c93924e5af8b8bb8b8. --- gunicorn/util.py | 27 +++------------------------ 1 file changed, 3 insertions(+), 24 deletions(-) diff --git a/gunicorn/util.py b/gunicorn/util.py index 4216bf8d..697d934c 100644 --- a/gunicorn/util.py +++ b/gunicorn/util.py @@ -418,32 +418,11 @@ def daemonize(): os.umask(0) maxfd = get_maxfd() - - fds = [] - if 'GUNICORN_INHERIT_FDS' in os.environ: - list_fds = os.environ['GUNICORN_INHERIT_FDS'].split(',') - try: - fds = [int(fd) for fd in list_fds] - except ValueError: - raise RuntimeError("Bad value in 'GUNICORN_INHERIT_FDS'") - - for fd in range(0, max_fd): - if fd in fds: - continue - - try: - os.close(fd) - except OSError: # ERROR, fd wasn't open to begin with (ignored) - pass - else: - closerange(0, maxfd) + closerange(0, maxfd) os.open(REDIRECT_TO, os.O_RDWR) - if 1 not in fds: - os.dup2(0, 1) - - if 2 not in fds: - os.dup2(0, 2) + os.dup2(0, 1) + os.dup2(0, 2) def seed():