summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/list.h5
-rw-r--r--login-utils/sulogin-consoles.c4
-rw-r--r--login-utils/sulogin.c5
3 files changed, 5 insertions, 9 deletions
diff --git a/include/list.h b/include/list.h
index 3c08aa5f2..cf022fb22 100644
--- a/include/list.h
+++ b/include/list.h
@@ -33,11 +33,6 @@ struct list_head {
struct list_head *next, *prev;
};
-#define LIST_HEAD_INIT(name) { &(name), &(name) }
-
-#define LIST_HEAD(name) \
- struct list_head name = LIST_HEAD_INIT(name)
-
#define INIT_LIST_HEAD(ptr) do { \
(ptr)->next = (ptr); (ptr)->prev = (ptr); \
} while (0)
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) {
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.
*/