From 3ec6f464d146db2fc1eed80004ab52c854be33c2 Mon Sep 17 00:00:00 2001 From: Masatake YAMATO Date: Wed, 22 Nov 2023 04:30:59 +0900 Subject: [PATCH] lslocks: store list_add_tail when storing information extracted from /proc/$pid/fdinfo/$fd Signed-off-by: Masatake YAMATO --- misc-utils/lslocks.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/misc-utils/lslocks.c b/misc-utils/lslocks.c index d492cc1453..f662fff1b6 100644 --- a/misc-utils/lslocks.c +++ b/misc-utils/lslocks.c @@ -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) -- 2.47.3