From f5664477cbc7c5f94bf6e640adf01e47880a9b12 Mon Sep 17 00:00:00 2001 From: Werner Fink Date: Tue, 8 Jan 2013 15:38:40 +0100 Subject: include/ttyutils: add default chardata this one moves the init_chardata to include/ttyutils.h as well as to lib/include/ttyutils.c. Also the macros CTL/CTRL are fixed in agetty.c and sulogin.c to use the XOR variant CTL. [kzak@redhat.com: use macro rather than global variable for default chardata] Signed-off-by: Werner Fink Signed-off-by: Karel Zak --- login-utils/sulogin-consoles.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'login-utils/sulogin-consoles.c') diff --git a/login-utils/sulogin-consoles.c b/login-utils/sulogin-consoles.c index e1d36711c..b519f7f25 100644 --- a/login-utils/sulogin-consoles.c +++ b/login-utils/sulogin-consoles.c @@ -281,12 +281,6 @@ __attribute__((__nonnull__,__hot__)) #endif int append_console(struct list_head *consoles, const char *name) { - static const struct chardata initcp = { - .erase = CERASE, - .kill = CKILL, - .eol = CTRL('r'), - .parity = 0 - }; struct console *restrict tail; struct console *last = NULL; @@ -300,6 +294,7 @@ int append_console(struct list_head *consoles, const char *name) return -ENOMEM; INIT_LIST_HEAD(&tail->entry); + INIT_CHARDATA(&tail->cp); list_add_tail(&tail->entry, consoles); tail->tty = ((char *) tail) + alignof(struct console); @@ -311,7 +306,6 @@ int append_console(struct list_head *consoles, const char *name) tail->id = last ? last->id + 1 : 0; tail->pid = 0; memset(&tail->tio, 0, sizeof(tail->tio)); - memcpy(&tail->cp, &initcp, sizeof(struct chardata)); return 0; } -- cgit v1.2.3-55-g7522