summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Grosbein <eugen@FreeBSD.org>2020-12-18 12:24:33 +0000
committerEugene Grosbein <eugen@FreeBSD.org>2020-12-18 12:24:33 +0000
commit46062cb1a2d980ab8fc52a36a418bb44c06fe95f (patch)
tree6ed8f133893a2facbcf96954ec36294618eb5cea
parent6b148d74113d37538f064fdf558f07adeda06f38 (diff)
downloadsrc-test2-stable/11.tar.gz
src-test2-stable/11.zip
MFC r368148: fix hastd(8)stable/11
hastd(8) assumes it has no extra file descriptors opened and aborts otherwise, so call closefrom() early. PR: 227461
Notes
Notes: svn path=/stable/11/; revision=368759
-rw-r--r--sbin/hastd/hastd.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/sbin/hastd/hastd.c b/sbin/hastd/hastd.c
index 160dfef437e9..be58411b7ec7 100644
--- a/sbin/hastd/hastd.c
+++ b/sbin/hastd/hastd.c
@@ -1222,6 +1222,7 @@ main(int argc, char *argv[])
pjdlog_init(PJDLOG_MODE_STD);
pjdlog_debug_set(debuglevel);
+ closefrom(MAX(MAX(STDIN_FILENO, STDOUT_FILENO), STDERR_FILENO) + 1);
g_gate_load();
/*