]> git.ipfire.org Git - thirdparty/util-linux.git/commit
test_mkfds: reserve file descriptors in the early stage of execution
authorMasatake YAMATO <yamato@redhat.com>
Sat, 26 Oct 2024 17:05:45 +0000 (02:05 +0900)
committerMasatake YAMATO <yamato@redhat.com>
Thu, 31 Oct 2024 17:52:02 +0000 (02:52 +0900)
commit35eda933acd8c094ea54777a62e628d3654d3374
tree800e1232f60630046f741d60bd60a9e1f96d24c8
parent9e2aafe5a493284615a17572c4ead4737bcc66a3
test_mkfds: reserve file descriptors in the early stage of execution

A factory specified with command line opens some files.  After
opening, the factory remaps the opened file descriptors (ofds) to file
descriptors (rfds) specified with the command line with dup2 system all.

This remapping may fail if there is an overlap between ofds and rfds.
With this change, there cannot be an overlap between ofds and rfds;
test_mkfds reserves rfds in the early stage of execution.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
tests/helpers/test_mkfds.c