]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
lslocks: store list_add_tail when storing information extracted from /proc/$pid/fdinf...
authorMasatake YAMATO <yamato@redhat.com>
Tue, 21 Nov 2023 19:30:59 +0000 (04:30 +0900)
committerMasatake YAMATO <yamato@redhat.com>
Thu, 23 Nov 2023 13:10:57 +0000 (22:10 +0900)
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
misc-utils/lslocks.c

index d492cc14537a2fd66cbfeff7482932e37a1ee238..f662fff1b66e270813ea7abdc2d3a8fc8bb67dfa 100644 (file)
@@ -151,7 +151,7 @@ static void add_to_tree(void *troot, struct lock *l)
        struct lock_tnode *new_head;
 
        if (head) {
-               list_add(&l->locks, &(*head)->chain);
+               list_add_tail(&l->locks, &(*head)->chain);
                return;
        }
 
@@ -162,7 +162,7 @@ static void add_to_tree(void *troot, struct lock *l)
        if (tsearch(new_head, troot, lock_tnode_compare) == NULL)
                errx(EXIT_FAILURE, _("failed to allocate memory"));
 
-       list_add(&l->locks, &new_head->chain);
+       list_add_tail(&l->locks, &new_head->chain);
 }
 
 static void rem_lock(struct lock *lock)