From: Masatake YAMATO Date: Tue, 21 Nov 2023 19:30:59 +0000 (+0900) Subject: lslocks: store list_add_tail when storing information extracted from /proc/$pid/fdinf... X-Git-Tag: v2.40-rc1~149^2~4 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3ec6f464d146db2fc1eed80004ab52c854be33c2;p=thirdparty%2Futil-linux.git lslocks: store list_add_tail when storing information extracted from /proc/$pid/fdinfo/$fd Signed-off-by: Masatake YAMATO --- 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)