![]() ![]() | ![]() |
version 1.15, 2022/03/20 20:40:36 | version 1.18, 2022/03/25 20:54:51 | ||
---|---|---|---|
|
|
||
static void usage(void); | static void usage(void); | ||
int daemonize = 1; | |||
struct blind *bl; | struct blind *bl; | ||
static void | static void | ||
|
|
||
main(int argc, char *argv[]) | main(int argc, char *argv[]) | ||
{ | { | ||
int ch; | int ch; | ||
int verbose = 0; | int verbose = 0; | ||
int no_action = 0; | int no_action = 0; | ||
int daemonize = 1; | |||
const char *config = BL_CONF; | const char *config = BL_CONF; | ||
while ((ch = getopt(argc, argv, "dhnvf:")) != -1) { | while ((ch = getopt(argc, argv, "dhnvf:")) != -1) { | ||
|
|
||
if ((bl = config_init()) == NULL) | if ((bl = config_init()) == NULL) | ||
log_fatal("initialization failed"); | log_fatal("initialization failed"); | ||
bl->bl_opt |= verbose; | if (verbose) { | ||
log_setv(verbose); | bl->bl_opt |= verbose; | ||
log_debug("verbose on"); | log_setv(verbose); | ||
log_debug("verbose mode on"); | |||
} | |||
if (strlcpy(bl->bl_conf, config, PATH_MAX) >= PATH_MAX) | if (strlcpy(bl->bl_conf, config, PATH_MAX) >= PATH_MAX) | ||
log_fatal("file name exceeds PATH_MAX"); | log_fatal("file name exceeds PATH_MAX"); | ||
log_debug("config_load: %s", bl->bl_conf); | if (config_load(bl)) | ||
if (config_load(bl)) | log_fatal("config %s", bl->bl_conf); | ||
log_fatal("config_load: %s", bl->bl_conf); | |||
log_debug("conf=%s", bl->bl_conf); | |||
log_debug("conf=%s", bl->bl_conf); | log_debug("sock=%s", bl->bl_sock); | ||
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(" opt=%d", bl->bl_opt); | ||
log_debug(" flg=%d", bl->bl_flg); | log_debug(" flg=%d", bl->bl_flg); | ||
// TAILQ_INIT(&offline_queue) | // TAILQ_INIT(&offline_queue) | ||
// fork + process setup + communication setup | // fork + process setup + communication setup | ||
exit(0); | exit(0); | ||
} | } |