diff options
author | Werner Fink | 2013-01-08 15:38:40 +0100 |
---|---|---|
committer | Karel Zak | 2013-01-08 15:42:12 +0100 |
commit | f5664477cbc7c5f94bf6e640adf01e47880a9b12 (patch) | |
tree | 5d5f90a1be010cb56470da4ad73d33fa49554beb /login-utils | |
parent | include: cleanup copyright headers (diff) | |
download | kernel-qcow2-util-linux-f5664477cbc7c5f94bf6e640adf01e47880a9b12.tar.gz kernel-qcow2-util-linux-f5664477cbc7c5f94bf6e640adf01e47880a9b12.tar.xz kernel-qcow2-util-linux-f5664477cbc7c5f94bf6e640adf01e47880a9b12.zip |
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 <werner@suse.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'login-utils')
-rw-r--r-- | login-utils/sulogin-consoles.c | 8 | ||||
-rw-r--r-- | login-utils/sulogin-consoles.h | 2 | ||||
-rw-r--r-- | login-utils/sulogin.c | 4 |
3 files changed, 2 insertions, 12 deletions
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; } diff --git a/login-utils/sulogin-consoles.h b/login-utils/sulogin-consoles.h index c2f95eac7..f762e873a 100644 --- a/login-utils/sulogin-consoles.h +++ b/login-utils/sulogin-consoles.h @@ -28,8 +28,8 @@ #include <stdint.h> #include <stdio.h> #include <termios.h> -#include <list.h> +#include "list.h" #include "ttyutils.h" struct console { diff --git a/login-utils/sulogin.c b/login-utils/sulogin.c index 02fa8db57..cf429fe5c 100644 --- a/login-utils/sulogin.c +++ b/login-utils/sulogin.c @@ -58,10 +58,6 @@ #include "sulogin-consoles.h" #define CONMAX 16 -#define BS CTRL('h') -#define NL CTRL('j') -#define CR CTRL('m') - static unsigned int timeout; static int profile; static volatile uint32_t openfd; /* Remember higher file descriptors */ |