]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
include/list,lsfd: remove LIST_HEAD macro again
authorMasatake YAMATO <yamato@redhat.com>
Tue, 25 Mar 2025 18:36:50 +0000 (03:36 +0900)
committerMasatake YAMATO <yamato@redhat.com>
Tue, 25 Mar 2025 18:36:50 +0000 (03:36 +0900)
This reverts commit cafae2d19742ad56a05a51bb23b798dbbd5c62a8.
See 5d74cf0092b132bf224024548e46566033c84937 about the reason.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
include/list.h
lsfd-cmd/sock-xinfo.c

index b4597570313c01aa614f8f986b50b794724e4327..b6bbbdd8fef7020ffea3ca77b0c4e194d460ac6a 100644 (file)
@@ -35,9 +35,6 @@ struct list_head {
        struct list_head *next, *prev;
 };
 
-#define LIST_HEAD(name) \
-       struct list_head name = { .next = &(name), .prev = &(name) }
-
 #define INIT_LIST_HEAD(ptr) do { \
        (ptr)->next = (ptr); (ptr)->prev = (ptr); \
 } while (0)
index 6087563c1cd2c8f96b4401397cad3af5e3b62687..4134ef266d012d8ef0fa0f8432008f169f3ad076 100644 (file)
@@ -74,7 +74,7 @@ static struct stat self_netns_sb;
 static void *xinfo_tree;       /* for tsearch/tfind */
 static void *netns_tree;
 
-static LIST_HEAD(unix_ipcs);
+static struct list_head unix_ipcs;
 static void *unix_oneway_ipc_tree;     /* for tsearch/tfind */
 
 struct iface {
@@ -270,6 +270,8 @@ void initialize_sock_xinfos(void)
        DIR *dir;
        struct dirent *d;
 
+       INIT_LIST_HEAD(&unix_ipcs);
+
        self_netns_fd = open("/proc/self/ns/net", O_RDONLY);
 
        if (self_netns_fd < 0)