From: Karel Zak Date: Thu, 14 May 2026 10:07:23 +0000 (+0200) Subject: agetty: make longopts[] static const X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ff4cf8b0132847bcad7c45ce72cbe99f52561a19;p=thirdparty%2Futil-linux.git agetty: make longopts[] static const The getopt long options array is read-only, use static const to avoid re-initializing it on every parse_args() call. Signed-off-by: Karel Zak --- diff --git a/agetty-cmd/agetty.c b/agetty-cmd/agetty.c index 6d3eeea9d..7ceff5f48 100644 --- a/agetty-cmd/agetty.c +++ b/agetty-cmd/agetty.c @@ -189,7 +189,7 @@ static void parse_args(int argc, char **argv, struct agetty_options *op) LIST_SPEEDS_OPTION, ISSUE_SHOW_OPTION, }; - const struct option longopts[] = { + static const struct option longopts[] = { { "8bits", no_argument, NULL, '8' }, { "autologin", required_argument, NULL, 'a' }, { "noreset", no_argument, NULL, 'c' },