summaryrefslogtreecommitdiffstats
path: root/login-utils/sulogin.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.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.c')
-rw-r--r--login-utils/sulogin.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/login-utils/sulogin.c b/login-utils/sulogin.c
index 8dc2b639d..5b8712bfe 100644
--- a/login-utils/sulogin.c
+++ b/login-utils/sulogin.c
@@ -827,8 +827,7 @@ static void usage(FILE *out)
int main(int argc, char **argv)
{
- LIST_HEAD(consoles);
- struct list_head *ptr;
+ struct list_head *ptr, consoles;
struct console *con;
char *tty = NULL;
struct passwd *pwd;
@@ -849,6 +848,8 @@ int main(int argc, char **argv)
{ NULL, 0, 0, 0 }
};
+ INIT_LIST_HEAD(&consoles);
+
/*
* If we are init we need to set up a own session.
*/