Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/sys Fix the LIST_MOVE macro to properly update the back-...



details:   https://anonhg.NetBSD.org/src/rev/4bdd79747198
branches:  trunk
changeset: 826839:4bdd79747198
user:      pgoyette <pgoyette%NetBSD.org@localhost>
date:      Mon Oct 02 05:13:44 2017 +0000

description:
Fix the LIST_MOVE macro to properly update the back-pointer of the
first entry in the list.

Note that the signature of LIST_MOVE() macro also changes (it grew an
additional argument).  This should not require a kernel version bump
since nothing appears to use LIST_MOVE() other than the recently added
atf test.

diffstat:

 sys/sys/queue.h |  5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diffs (22 lines):

diff -r cfbccfda7b5a -r 4bdd79747198 sys/sys/queue.h
--- a/sys/sys/queue.h   Mon Oct 02 04:16:32 2017 +0000
+++ b/sys/sys/queue.h   Mon Oct 02 05:13:44 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: queue.h,v 1.70 2015/11/02 15:21:23 christos Exp $      */
+/*     $NetBSD: queue.h,v 1.71 2017/10/02 05:13:44 pgoyette Exp $      */
 
 /*
  * Copyright (c) 1991, 1993
@@ -211,10 +211,11 @@
            ((tvar) = LIST_NEXT((var), field), 1);                      \
            (var) = (tvar))
 
-#define        LIST_MOVE(head1, head2) do {                                    \
+#define        LIST_MOVE(head1, head2, field) do {                                     \
        LIST_INIT((head2));                                             \
        if (!LIST_EMPTY((head1))) {                                     \
                (head2)->lh_first = (head1)->lh_first;                  \
+               (head2)->lh_first->field.le_prev = &(head2)->lh_first;  \
                LIST_INIT((head1));                                     \
        }                                                               \
 } while (/*CONSTCOND*/0)



Home | Main Index | Thread Index | Old Index