]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: fd: add functions to set O_NONBLOCK and FD_CLOEXEC
authorWilly Tarreau <w@1wt.eu>
Tue, 26 Apr 2022 08:18:07 +0000 (10:18 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 26 Apr 2022 08:59:48 +0000 (10:59 +0200)
commita80e4a3546ccee7f8114a88a0a17e09e544d31e2
treeee2454d810c0727da366b44e2644e5be535e6508
parentb4f5fac886e83bf4d0cfef6d2b167f87bbd0b7e8
MINOR: fd: add functions to set O_NONBLOCK and FD_CLOEXEC

Instead of seeing each location manipulate the fcntl() themselves and
often forget to check previous flags, let's centralize the functions to
do this. It also allows to drop fcntl.h from most call places and will
ease the adoption of different OS-specific mechanisms if needed. Note
that the fd_set_nonblock() function purposely doesn't check the previous
flags as it's meant to be used on new FDs only.
include/haproxy/fd.h
src/fd.c