From bdc723af402dc7050badd1e07f0959403b606869 Mon Sep 17 00:00:00 2001 From: Masatake YAMATO Date: Wed, 26 Mar 2025 03:36:50 +0900 Subject: [PATCH] include/list,lsfd: remove LIST_HEAD macro again This reverts commit cafae2d19742ad56a05a51bb23b798dbbd5c62a8. See 5d74cf0092b132bf224024548e46566033c84937 about the reason. Signed-off-by: Masatake YAMATO --- include/list.h | 3 --- lsfd-cmd/sock-xinfo.c | 4 +++- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/include/list.h b/include/list.h index b459757031..b6bbbdd8fe 100644 --- a/include/list.h +++ b/include/list.h @@ -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) diff --git a/lsfd-cmd/sock-xinfo.c b/lsfd-cmd/sock-xinfo.c index 6087563c1c..4134ef266d 100644 --- a/lsfd-cmd/sock-xinfo.c +++ b/lsfd-cmd/sock-xinfo.c @@ -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) -- 2.47.3