summaryrefslogtreecommitdiffstats
path: root/login-utils/sulogin-consoles.c
diff options
context:
space:
mode:
authorKarel Zak2017-01-05 11:54:59 +0100
committerKarel Zak2017-01-05 11:54:59 +0100
commit5d74cf0092b132bf224024548e46566033c84937 (patch)
treec5741b9311f215f8111f6743115480c3e1631e6a /login-utils/sulogin-consoles.c
parentsfdisk: unused parameter 'sf' [-Wunused-parameter] (diff)
downloadkernel-qcow2-util-linux-5d74cf0092b132bf224024548e46566033c84937.tar.gz
kernel-qcow2-util-linux-5d74cf0092b132bf224024548e46566033c84937.tar.xz
kernel-qcow2-util-linux-5d74cf0092b132bf224024548e46566033c84937.zip
lib/list: remove LIST_HEAD macro
* the variable definition with hidden type is always horrible, for example: int func() { LIST_HEAD(foo); ... } the more readable is: int func() { struct list_head foo; INIT_LIST_HEAD(&foo); ... } * the name LIST_HEAD conflict with /usr/include/sys/queue.h * we use it only on two places in sulogin Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'login-utils/sulogin-consoles.c')
-rw-r--r--login-utils/sulogin-consoles.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/login-utils/sulogin-consoles.c b/login-utils/sulogin-consoles.c
index 532e7e7c7..30a0f042a 100644
--- a/login-utils/sulogin-consoles.c
+++ b/login-utils/sulogin-consoles.c
@@ -802,8 +802,7 @@ int main(int argc, char *argv[])
{
char *name = NULL;
int fd, re;
- LIST_HEAD(consoles);
- struct list_head *p;
+ struct list_head *p, consoles;
if (argc == 2) {
name = argv[1];
@@ -816,6 +815,7 @@ int main(int argc, char *argv[])
if (!name)
errx(EXIT_FAILURE, "usage: %s [<tty>]\n", program_invocation_short_name);
+ INIT_LIST_HEAD(&consoles);
re = detect_consoles(name, fd, &consoles);
list_for_each(p, &consoles) {