]> git.ipfire.org Git - thirdparty/util-linux.git/commit
lib/fileutils: make close_all_fds() to be similar with close_range()
authorSami Kerola <kerolasa@iki.fi>
Wed, 2 Dec 2020 22:56:16 +0000 (22:56 +0000)
committerSami Kerola <kerolasa@iki.fi>
Thu, 3 Dec 2020 20:09:14 +0000 (20:09 +0000)
commita75700d86e2a0245d28fdf2762638d07efc549a0
tree332e2844f13611ea7bb02deb74cc6b708b54760d
parentf0649c0d83f30c7e2318ba0f578a55d875cca4d7
lib/fileutils: make close_all_fds() to be similar with close_range()

The util-linux close_all_fds() serves the same purpose as close_range()
that will over time obsolete local implementation completely.  For
upcoming few years it is best to have a fallback that uses same input
arguments as the new system call.  That allows surrounding code and
variables not to be affected by version of mass file descriptor closing
function.

Proposed-by: Karel Zak <kzak@redhat.com>
Reference: https://github.com/karelzak/util-linux/pull/1205#discussion_r534080128
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
include/fileutils.h
lib/fileutils.c
login-utils/login.c