mirror of
https://github.com/frappe/gunicorn.git
synced 2026-01-14 11:09:11 +08:00
Undo changes that make -R branch logic behave the same as non -R branch,
that is, to close(0) and open /dev/null as fd=0 instead of fd=3. (Partially) Revert "Ensure fd 0 stdin </dev/null is always inheritable." This partially reverts commit 7946678f271e25473618929d6f2725c8c375563e.
This commit is contained in:
parent
e9c4f7443e
commit
0b6939de86
@ -497,17 +497,13 @@ def daemonize(enable_stdio_inheritance=False):
|
||||
os.dup2(fd_null, 2)
|
||||
|
||||
else:
|
||||
fd_null = os.open(REDIRECT_TO, os.O_RDWR)
|
||||
|
||||
# Always redirect stdin to /dev/null as we would
|
||||
# never expect to need to read interactive input.
|
||||
|
||||
os.close(0)
|
||||
|
||||
fd_null = os.open(REDIRECT_TO, os.O_RDWR)
|
||||
# PEP 446, make fd for /dev/null inheritable
|
||||
os.set_inheritable(fd_null, True)
|
||||
|
||||
# expect fd_null to be always 0 here, but in-case not ...
|
||||
if fd_null != 0:
|
||||
os.close(0)
|
||||
os.dup2(fd_null, 0)
|
||||
|
||||
# If stdout and stderr are still connected to
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user