Source-Changes-HG archive

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

[src/trunk]: src/usr.sbin/dhcp/server - In parse_host_declaration, check for ...



details:   https://anonhg.NetBSD.org/src/rev/a5e1bd2d8afc
branches:  trunk
changeset: 487767:a5e1bd2d8afc
user:      mellon <mellon%NetBSD.org@localhost>
date:      Mon Jun 12 19:48:46 2000 +0000

description:
- In parse_host_declaration, check for boolean status from clone_group,
  not isc_result_t.

diffstat:

 usr.sbin/dhcp/server/confpars.c |  15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)

diffs (54 lines):

diff -r b02ce94bb58c -r a5e1bd2d8afc usr.sbin/dhcp/server/confpars.c
--- a/usr.sbin/dhcp/server/confpars.c   Mon Jun 12 18:57:43 2000 +0000
+++ b/usr.sbin/dhcp/server/confpars.c   Mon Jun 12 19:48:46 2000 +0000
@@ -43,7 +43,7 @@
 
 #ifndef lint
 static char copyright[] =
-"$Id: confpars.c,v 1.1.1.10 2000/06/10 18:05:31 mellon Exp $ Copyright (c) 1995-2000 The Internet Software Consortium.  All rights reserved.\n";
+"$Id: confpars.c,v 1.2 2000/06/12 19:48:46 mellon Exp $ Copyright (c) 1995-2000 The Internet Software Consortium.  All rights reserved.\n";
 #endif /* not lint */
 
 #include "dhcpd.h"
@@ -313,7 +313,7 @@
                        log_fatal ("Can't allocate shared subnet: %s",
                                   isc_result_totext (status));
                if (!clone_group (&share -> group, group, MDL))
-                       log_fatal ("Can't allocate group for shared subnet.");
+                       log_fatal ("Can't allocate group for shared net");
                shared_network_reference (&share -> group -> shared_network,
                                          share, MDL);
 
@@ -1070,9 +1070,11 @@
        pool = (struct pool *)0;
        status = pool_allocate (&pool, MDL);
        if (status != ISC_R_SUCCESS)
-               log_fatal ("no memory for pool.");
+               log_fatal ("no memory for pool: %s",
+                          isc_result_totext (status));
 
-       clone_group (&pool -> group, group, MDL);
+       if (!clone_group (&pool -> group, group, MDL))
+               log_fatal ("can't clone pool group.");
 
        if (type == SUBNET_DECL)
                shared_network_reference (&pool -> shared_network,
@@ -1369,7 +1371,7 @@
                log_fatal ("can't allocate host decl struct %s: %s",
                           name, isc_result_totext (status));
        host -> name = name;
-       if (clone_group (&host -> group, group, MDL) != ISC_R_SUCCESS) {
+       if (!clone_group (&host -> group, group, MDL)) {
                log_fatal ("can't clone group for host %s: %s",
                           name, isc_result_totext (status));
              boom:
@@ -1708,7 +1710,8 @@
                        return cp ? (status == ISC_R_SUCCESS) : 1;
                }
                /* Give the subclass its own group. */
-               clone_group (&class -> group, class -> group, MDL);
+               if (!clone_group (&class -> group, class -> group, MDL))
+                       log_fatal ("can't clone class group.");
        }
 
        if (!parse_lbrace (cfile)) {



Home | Main Index | Thread Index | Old Index