Source-Changes-HG archive

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

[src/trunk]: src/distrib/utils/sysinst Check for del_rc_conf() == 0, not !del...



details:   https://anonhg.NetBSD.org/src/rev/e8476dd7662d
branches:  trunk
changeset: 779091:e8476dd7662d
user:      riz <riz%NetBSD.org@localhost>
date:      Tue May 01 18:28:47 2012 +0000

description:
Check for del_rc_conf() == 0, not !del_rc_conf(), and fix a couple of
instances where the check was wrong.  sysinst now properly saves dhcp
and host config again.

diffstat:

 distrib/utils/sysinst/net.c |  16 +++++++++-------
 1 files changed, 9 insertions(+), 7 deletions(-)

diffs (44 lines):

diff -r edb2c5209449 -r e8476dd7662d distrib/utils/sysinst/net.c
--- a/distrib/utils/sysinst/net.c       Tue May 01 17:32:58 2012 +0000
+++ b/distrib/utils/sysinst/net.c       Tue May 01 18:28:47 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: net.c,v 1.131 2012/04/06 23:48:54 riz Exp $    */
+/*     $NetBSD: net.c,v 1.132 2012/05/01 18:28:47 riz Exp $    */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -1161,8 +1161,8 @@
                return;
 
        /* Write hostname to /etc/rc.conf */
-       if ((net_dhcpconf & DHCPCONF_HOST) == 0)
-               if (del_rc_conf("hostname"))
+       if ((net_dhcpconf & DHCPCONF_HOST) == 0) 
+               if (del_rc_conf("hostname") == 0)
                        add_rc_conf("hostname=%s\n", recombine_host_domain());
 
        /* Copy resolv.conf to target.  If DHCP was used to create it,
@@ -1227,17 +1227,19 @@
                        fclose(hosts);
                }
 
-               if (!del_rc_conf("defaultroute"))
+               if (del_rc_conf("defaultroute") == 0)
                        add_rc_conf("defaultroute=\"%s\"\n", net_defroute);
        } else {
-               if (snprintf(ifconfig_str, sizeof ifconfig_str, "ifconfig_%s", net_dev) > 0
-                               && del_rc_conf(ifconfig_str))
+               if (snprintf(ifconfig_str, sizeof ifconfig_str,
+                   "ifconfig_%s", net_dev) > 0 &&
+                   del_rc_conf(ifconfig_str) == 0) {
                        add_rc_conf("ifconfig_%s=dhcp\n", net_dev);
+               }
         }
 
 #ifdef INET6
        if ((net_ip6conf & IP6CONF_AUTOHOST) != 0) {
-               if (!del_rc_conf("ip6mode"))
+               if (del_rc_conf("ip6mode") == 0)
                        add_rc_conf("ip6mode=autohost\n");
                if (ifconf != NULL) {
                        scripting_fprintf(NULL, "cat <<EOF >>%s%s\n",



Home | Main Index | Thread Index | Old Index