mirror of
https://github.com/frappe/gunicorn.git
synced 2026-01-14 11:09:11 +08:00
Be more considerate to future me.
Sergey points out that its more proper to |= with the current value of the fd flags. I concur.
This commit is contained in:
parent
09b5dd2ad1
commit
61a84eece3
@ -76,7 +76,9 @@ def get_maxfd():
|
||||
return maxfd
|
||||
|
||||
def close_on_exec(fd):
|
||||
fcntl.fcntl(fd, fcntl.F_SETFD, fcntl.FD_CLOEXEC)
|
||||
flags = fcntl.fcntl(fd, fcntl.F_GETFD)
|
||||
flags |= fcntl.FD_CLOEXEC
|
||||
fcntl.fcntl(fd, fcntl.F_SETFD, flags)
|
||||
|
||||
def set_non_blocking(fd):
|
||||
flags = fcntl.fcntl(fd, fcntl.F_GETFL) | os.O_NONBLOCK
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user