From 697b33ae80581238ca5611c0475bc9b11b0f1e5e Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Thu, 18 Mar 2021 15:48:25 -0400 Subject: [PATCH] Put a lower bound on autocons geometry If some glitch happens during the read, do not end up with absurdly low geometry. --- confluent_osdeploy/utils/autocons.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/confluent_osdeploy/utils/autocons.c b/confluent_osdeploy/utils/autocons.c index 75389af9..6f1ce935 100644 --- a/confluent_osdeploy/utils/autocons.c +++ b/confluent_osdeploy/utils/autocons.c @@ -120,6 +120,8 @@ int main(int argc, char* argv[]) { ws.ws_col = 100; ws.ws_row = 31; } + if (ws.ws_col < 80) { ws.ws_col = 80; } + if (ws.ws_row < 24) { ws.ws_col = 24; } ioctl(ttyf, TIOCSWINSZ, &ws); tcsetattr(ttyf, TCSANOW, &tty); ioctl(ttyf, TIOCCONS, 0);