=================================================================== RCS file: /cvs/cvs/blind/blind.c,v retrieving revision 1.20 retrieving revision 1.24 diff -u -p -r1.20 -r1.24 --- blind/blind.c 2022/04/03 09:14:25 1.20 +++ blind/blind.c 2022/10/29 06:20:52 1.24 @@ -43,7 +43,7 @@ main(int argc, char *argv[]) int ch; int verbose = 0; int no_action = 0; - int daemonize = 1; + int daemonize = 1; const char *config = BL_CONF; while ((ch = getopt(argc, argv, "dhnvf:")) != -1) { @@ -57,6 +57,7 @@ main(int argc, char *argv[]) break; case 'n': no_action = 1; + daemonize = 0; break; case 'f': config = optarg; @@ -90,16 +91,23 @@ main(int argc, char *argv[]) log_fatal("file name exceeds PATH_MAX"); if (config_load(bl)) - log_fatal("config %s", bl->bl_conf); + log_fatal("%s", bl->bl_conf); + if (no_action) { + // check config + log_info("configuration ok"); + free(bl); + exit(0); + } + log_debug("conf=%s", bl->bl_conf); log_debug("sock=%s", bl->bl_sock); log_debug(" ttl=%d", bl->bl_ttl); log_debug(" opt=%d", bl->bl_opt); - // to be continued + // to be continued or not - free(bl); + free(bl); exit(0); }