mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-09-01 23:25:38 +00:00
don't throw an assertion failure when cfg_check_namedconf() returns
failure
This commit is contained in:
@@ -15,7 +15,7 @@
|
|||||||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* $Id: named-checkconf.c,v 1.9 2001/06/29 01:04:55 gson Exp $ */
|
/* $Id: named-checkconf.c,v 1.10 2001/07/16 17:53:22 gson Exp $ */
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
|
||||||
@@ -77,6 +77,7 @@ main(int argc, char **argv) {
|
|||||||
const char *conffile = NULL;
|
const char *conffile = NULL;
|
||||||
isc_mem_t *mctx = NULL;
|
isc_mem_t *mctx = NULL;
|
||||||
isc_result_t result;
|
isc_result_t result;
|
||||||
|
int exit_status = 0;
|
||||||
|
|
||||||
while ((c = isc_commandline_parse(argc, argv, "t:v")) != EOF) {
|
while ((c = isc_commandline_parse(argc, argv, "t:v")) != EOF) {
|
||||||
switch (c) {
|
switch (c) {
|
||||||
@@ -121,7 +122,9 @@ main(int argc, char **argv) {
|
|||||||
ISC_R_SUCCESS)
|
ISC_R_SUCCESS)
|
||||||
exit(1);
|
exit(1);
|
||||||
|
|
||||||
RUNTIME_CHECK(cfg_check_namedconf(config, log, mctx) == ISC_R_SUCCESS);
|
result = cfg_check_namedconf(config, log, mctx);
|
||||||
|
if (result != ISC_R_SUCCESS)
|
||||||
|
exit_status = 1;
|
||||||
|
|
||||||
cfg_obj_destroy(parser, &config);
|
cfg_obj_destroy(parser, &config);
|
||||||
|
|
||||||
@@ -131,5 +134,5 @@ main(int argc, char **argv) {
|
|||||||
|
|
||||||
isc_mem_destroy(&mctx);
|
isc_mem_destroy(&mctx);
|
||||||
|
|
||||||
return (0);
|
return (exit_status);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user