]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
lsfd: add a helper function, init_endpoint
authorMasatake YAMATO <yamato@redhat.com>
Sat, 4 Mar 2023 05:25:20 +0000 (14:25 +0900)
committerMasatake YAMATO <yamato@redhat.com>
Thu, 18 May 2023 18:27:27 +0000 (03:27 +0900)
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
misc-utils/lsfd-fifo.c
misc-utils/lsfd.c
misc-utils/lsfd.h

index 02951607349b55960ef75af8033ae4c4d699aa42..fc5ba390cbb9fce8bf44f9bf8a205b0705a4d155 100644 (file)
@@ -121,7 +121,7 @@ static void fifo_initialize_content(struct file *file)
        struct ipc *ipc;
        unsigned int hash;
 
-       INIT_LIST_HEAD(&fifo->endpoint.endpoints);
+       init_endpoint(&fifo->endpoint);
        ipc = get_ipc(file);
        if (ipc)
                goto link;
index a5dcc1884f72ebab217d50151e5d6951f64c93c1..7aade762ee7ab347e1fbc5245ebab15721166d6b 100644 (file)
@@ -1101,6 +1101,11 @@ void add_ipc(struct ipc *ipc, unsigned int hash)
        list_add(&ipc->ipcs, &ipc_table.tables[slot]);
 }
 
+void init_endpoint(struct ipc_endpoint *endpoint)
+{
+       INIT_LIST_HEAD(&endpoint->endpoints);
+}
+
 void add_endpoint(struct ipc_endpoint *endpoint, struct ipc *ipc)
 {
        endpoint->ipc = ipc;
index 09a29043281de680b7015fe03bfe6269888bbf4b..b0c3748bd1e3a8e31e42ecfbe91a3892be06d268 100644 (file)
@@ -212,6 +212,7 @@ struct ipc_class {
 struct ipc *new_ipc(const struct ipc_class *class);
 struct ipc *get_ipc(struct file *file);
 void add_ipc(struct ipc *ipc, unsigned int hash);
+void init_endpoint(struct ipc_endpoint *endpoint);
 void add_endpoint(struct ipc_endpoint *endpoint, struct ipc *ipc);
 
 /*