]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
lib/consoles: remove global variable initcp
authorKarel Zak <kzak@redhat.com>
Thu, 8 Nov 2012 16:25:09 +0000 (17:25 +0100)
committerKarel Zak <kzak@redhat.com>
Thu, 8 Nov 2012 16:25:09 +0000 (17:25 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
lib/consoles.c

index 2e9793f0ed129bfe50c3b95984d7bbdd2a3a5eb7..bc7c039bdd5afad33ec7779710e7bea0e1c019ac 100644 (file)
@@ -170,13 +170,6 @@ char* scandev(DIR *dir, dev_t comparedev)
 /*
  * Default control characters for an unknown terminal line.
  */
-static
-struct chardata initcp = {
-       CERASE,
-       CKILL,
-       CTRL('r'),
-       0
-};
 
 /*
  * Allocate an aligned `struct console' memory area,
@@ -192,8 +185,15 @@ __attribute__((__nonnull__,__hot__))
 #endif
 void consalloc(char * name)
 {
+       static const struct chardata initcp = {
+               .erase  = CERASE,
+               .kill   = CKILL,
+               .eol    = CTRL('r'),
+               .parity = 0
+       };
        struct console *restrict tail;
 
+
        if (posix_memalign((void*)&tail, sizeof(void*), alignof(typeof(struct console))) != 0)
                perror("memory allocation");