Source-Changes-HG archive

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

[src/trunk]: src/usr.sbin/sysinst Use FOREACH_SAFE when removing devices from...



details:   https://anonhg.NetBSD.org/src/rev/7a437038c222
branches:  trunk
changeset: 450636:7a437038c222
user:      martin <martin%NetBSD.org@localhost>
date:      Sun Apr 21 07:50:59 2019 +0000

description:
Use FOREACH_SAFE when removing devices from our internal list.

diffstat:

 usr.sbin/sysinst/partman.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (21 lines):

diff -r c75c0752232f -r 7a437038c222 usr.sbin/sysinst/partman.c
--- a/usr.sbin/sysinst/partman.c        Sun Apr 21 06:48:37 2019 +0000
+++ b/usr.sbin/sysinst/partman.c        Sun Apr 21 07:50:59 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: partman.c,v 1.30 2019/02/12 18:32:15 martin Exp $ */
+/*     $NetBSD: partman.c,v 1.31 2019/04/21 07:50:59 martin Exp $ */
 
 /*
  * Copyright 2012 Eugene Lozovoy
@@ -1998,9 +1998,9 @@
 pm_clean(void)
 {
        int count = 0;
-       pm_devs_t *pm_i;
+       pm_devs_t *pm_i, *tmp;
 
-       SLIST_FOREACH(pm_i, &pm_head, l)
+       SLIST_FOREACH_SAFE(pm_i, &pm_head, l, tmp)
                if (! pm_i->found) {
                        count++;
                        SLIST_REMOVE(&pm_head, pm_i, pm_devs_t, l);



Home | Main Index | Thread Index | Old Index