Skip to content

Commit

Permalink
fcntl(fd, FD_CLOEXEC) => os.set_inheritable(fd, False)
Browse files Browse the repository at this point in the history
  • Loading branch information
pajod committed May 12, 2024
1 parent 5b68c17 commit f8b3e99
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions gunicorn/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,9 +256,10 @@ def parse_address(netloc, default_port='8000'):


def close_on_exec(fd):
flags = fcntl.fcntl(fd, fcntl.F_GETFD)
flags |= fcntl.FD_CLOEXEC
fcntl.fcntl(fd, fcntl.F_SETFD, flags)
# available since Python 3.4, equivalent to either:
# ioctl(fd, FIOCLEX)
# fcntl(fd, fcntl.F_SETFD, fcntl.FD_CLOEXEC)
os.set_inheritable(fd, False)


def set_non_blocking(fd):
Expand Down

0 comments on commit f8b3e99

Please sign in to comment.