Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #58 from Cofyc/checkconf

exit 1 if configuration file is invalid
  • Loading branch information...
commit 4632567bfcb3ba90e2c46d01fbe622b263faecec 2 parents 8a7096c + 462e0cf
Manju Rajashekhar authored
Showing with 4 additions and 4 deletions.
  1. +4 −4 src/nc.c
View
8 src/nc.c
@@ -430,7 +430,7 @@ nc_get_options(int argc, char **argv, struct instance *nci)
return NC_OK;
}
-static void
+static int
nc_test_conf(struct instance *nci)
{
struct conf *cf;
@@ -439,13 +439,14 @@ nc_test_conf(struct instance *nci)
if (cf == NULL) {
log_stderr("nutcracker: configuration file '%s' syntax is invalid",
nci->conf_filename);
- return;
+ return 1;
}
conf_destroy(cf);
log_stderr("nutcracker: configuration file '%s' syntax is ok",
nci->conf_filename);
+ return 0;
}
static rstatus_t
@@ -548,8 +549,7 @@ main(int argc, char **argv)
}
if (test_conf) {
- nc_test_conf(&nci);
- exit(0);
+ exit(nc_test_conf(&nci));
}
status = nc_pre_run(&nci);
Please sign in to comment.
Something went wrong with that request. Please try again.