Skip to contentSkip to conversation

agetty: add static and const qualifiers

PATCH Applied Francesco Cosoleto 2 participants 2 messages Dec 15, 2011 – Dec 16, 2011 Util-Linux package

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 agetty: add static and const qualifiers

Remove also a static qualifier in main() function.

---
 term-utils/agetty.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
term-utils/agetty.c +4 -4
index 041e1f7..86902a1 100644
@@ -190,7 +190,7 @@ struct chardata {
 };
 
 /* Initial values for the above. */
-struct chardata init_chardata = {
+static const struct chardata init_chardata = {
 	DEF_ERASE,		/* default erase character */
 	DEF_KILL,		/* default kill character */
 	13,			/* default eol char */
@@ -203,7 +203,7 @@ struct Speedtab {
 	speed_t code;
 };
 
-static struct Speedtab speedtab[] = {
+static const struct Speedtab speedtab[] = {
 	{50, B50},
 	{75, B75},
 	{110, B110},
@@ -282,7 +282,7 @@ int main(int argc, char **argv)
 	char *username = NULL;			/* login name, given to /bin/login */
 	struct chardata chardata;		/* will be set by get_logname() */
 	struct termios termios;			/* terminal mode bits */
-	static struct options options = {
+	struct options options = {
 		.flags  =  F_ISSUE,		/* show /etc/issue (SYSV_STYLE) */
 		.login  =  _PATH_LOGIN,		/* default login program */
 		.tty    = "tty1",		/* default tty line */
@@ -1636,7 +1636,7 @@ static int caps_lock(char *s)
 /* Convert speed string to speed code; return 0 on failure. */
 static speed_t bcode(char *s)
 {
-	struct Speedtab *sp;
+	const struct Speedtab *sp;
 	long speed = atol(s);
 
 	for (sp = speedtab; sp->speed; sp++)
Signature · 1 line
1.7.3.4
maintainer Applied
#1 lore raw
Quoted 2 lines · Francesco Cosoleto
 term-utils/agetty.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

Applied, thanks.

Signature · 2 lines
 Karel Zak  <[email protected]>
 http://karelzak.blogspot.com