=================================================================== RCS file: /cvs/cvs/blind/blind.c,v retrieving revision 1.9 retrieving revision 1.12 diff -u -p -r1.9 -r1.12 --- blind/blind.c 2022/03/18 20:54:01 1.9 +++ blind/blind.c 2022/03/19 10:04:59 1.12 @@ -27,8 +27,7 @@ static void usage(void); int daemonize = 1; -int verbose = 0; -struct blind *bl; +struct blind *bl; static void usage(void) @@ -43,6 +42,7 @@ int main(int argc, char *argv[]) { int ch; + int verbose = 0; int no_action = 0; const char *config = BL_CONF; @@ -62,7 +62,7 @@ main(int argc, char *argv[]) config = optarg; break; case 'v': - verbose = 1; + verbose = BL_OPT_VERBOSE; break; default: usage(); @@ -74,26 +74,32 @@ main(int argc, char *argv[]) if (argc || *argv) usage(); - log_initialize(daemonize, LOG_DAEMON); - log_setverbose(verbose); + log_init(daemonize, LOG_DAEMON); log_info("%s %s starting", BL_TEXT, BL_VERS); - log_debug("verbose mode"); - if ((bl = config_init()) == NULL) - log_fatal("config default"); + if ((bl = config_init()) == NULL) + log_fatal("default values init failed"); - if (strlcpy(bl->bl_conf, config, PATH_MAX)>= PATH_MAX) - log_fatal("config file exceeds PATH_MAX"); + bl->bl_opt |= verbose; + log_setv(verbose); + log_debug("verbose mode on"); - // conf file + if (strlcpy(bl->bl_conf, config, PATH_MAX) >= PATH_MAX) + log_fatal("config file name exceeds PATH_MAX"); - // parse config + // if (parse_config(bl, config, opt)) + // exit(1) // log_fatal("parsing conf file failed"); + // int parse_config(struct smtpd *, const char *, int); log_debug("conf=%s", bl->bl_conf); log_debug("sock=%s", bl->bl_sock); - log_debug("ttl=%d", bl->bl_ttl); - + log_debug(" ttl=%d", bl->bl_ttl); + log_debug(" opt=%d", bl->bl_opt); + log_debug(" flg=%d", bl->bl_flg); + // TAILQ_INIT(&offline_queue) + + // fork + process setup + communication setup exit(0); }