Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/config define the attribute first.



details:   https://anonhg.NetBSD.org/src/rev/63a4002b49be
branches:  trunk
changeset: 347732:63a4002b49be
user:      christos <christos%NetBSD.org@localhost>
date:      Tue Sep 13 16:06:59 2016 +0000

description:
define the attribute first.

diffstat:

 usr.bin/config/sem.c |  19 ++++++++++---------
 1 files changed, 10 insertions(+), 9 deletions(-)

diffs (47 lines):

diff -r f0e9e920ad9d -r 63a4002b49be usr.bin/config/sem.c
--- a/usr.bin/config/sem.c      Tue Sep 13 15:57:50 2016 +0000
+++ b/usr.bin/config/sem.c      Tue Sep 13 16:06:59 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sem.c,v 1.76 2016/09/09 21:09:11 christos Exp $        */
+/*     $NetBSD: sem.c,v 1.77 2016/09/13 16:06:59 christos Exp $        */
 
 /*
  * Copyright (c) 1992, 1993
@@ -45,7 +45,7 @@
 #endif
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: sem.c,v 1.76 2016/09/09 21:09:11 christos Exp $");
+__RCSID("$NetBSD: sem.c,v 1.77 2016/09/13 16:06:59 christos Exp $");
 
 #include <sys/param.h>
 #include <ctype.h>
@@ -336,6 +336,14 @@
        struct attr *a, *dep;
        struct attrlist *al;
 
+       if (getrefattr(name, &a)) {
+               cfgerror("attribute `%s' already defined", name);
+               loclist_destroy(locs);
+               return (1);
+       }
+       if (a == NULL)
+               a = mkattr(name);
+
        /*
         * If this attribute depends on any others, make sure none of
         * the dependencies are interface attributes.
@@ -352,13 +360,6 @@
                CFGDBG(2, "attr `%s' depends on attr `%s'", name, dep->a_name);
        }
 
-       if (getrefattr(name, &a)) {
-               cfgerror("attribute `%s' already defined", name);
-               loclist_destroy(locs);
-               return (1);
-       }
-       if (a == NULL)
-               a = mkattr(name);
 
        a->a_deps = deps;
        expandattr(a, NULL);



Home | Main Index | Thread Index | Old Index