]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
lslocks: (refactor) specify list_head as type instead of abusing void*
authorMasatake YAMATO <yamato@redhat.com>
Tue, 9 Dec 2025 22:11:39 +0000 (07:11 +0900)
committerMasatake YAMATO <yamato@redhat.com>
Sun, 21 Dec 2025 19:41:12 +0000 (04:41 +0900)
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
misc-utils/lslocks.c

index a5ebd25a7ac44031dcc523bcfc1d97797a68fbf6..e080904786c879c4cda7c1063a50c398c0f0c92c 100644 (file)
@@ -324,7 +324,7 @@ static void patch_lock(struct lock *l, void *fallback)
        }
 }
 
-static void add_to_list(void *locks, struct lock *l)
+static void add_to_list(struct list_head *locks, struct lock *l)
 {
        list_add(&l->locks, locks);
 }
@@ -525,7 +525,7 @@ static void get_pids_locks(void *locks, void (*add_lock)(void *, struct lock *))
        return;
 }
 
-static int get_proc_locks(void *locks, void (*add_lock)(void *, struct lock *), void *fallback)
+static int get_proc_locks(struct list_head *locks, void (*add_lock)(struct list_head *, struct lock *), void *fallback)
 {
        FILE *fp;
        char buf[PATH_MAX];