]> git.ipfire.org Git - thirdparty/mdadm.git/commit
start_mdmon: provide more dynamic way to close-all-fds
authorNeilBrown <neilb@suse.de>
Wed, 7 Sep 2011 03:00:32 +0000 (13:00 +1000)
committerNeilBrown <neilb@suse.de>
Wed, 7 Sep 2011 03:00:32 +0000 (13:00 +1000)
commit1913c3256bb657954dd84c3a73c11944a225ec04
treeac61232002eced33bac5d92055ec7e4b137cf3e0
parent75c2df6509391e28257d696815bddb854a8c4a94
start_mdmon: provide more dynamic way to close-all-fds

When forking mdmon we need to close all other fds because we don't
use O_CLOEXEC yet.
Any approach will be fairly arbitrary, but as we can expect fds to be
fairly dense, closing until we find a set number that don't need
closing is possible safer than only closing the first 100.
So keep closing until we find 20 that are already closed.

Signed-off-by: NeilBrown <neilb@suse.de>
util.c