version 1.17, 2022/03/22 02:15:51 |
version 1.21, 2022/04/03 11:01:52 |
|
|
|
|
#include <stdio.h> |
#include <stdio.h> |
#include <stdlib.h> |
#include <stdlib.h> |
#include <unistd.h> |
|
#include <string.h> |
#include <string.h> |
#include <syslog.h> |
#include <syslog.h> |
|
#include <unistd.h> |
|
|
#include "blind.h" |
#include "blind.h" |
#include "config.h" |
#include "config.h" |
|
|
|
|
static void usage(void); |
static void usage(void); |
|
|
int daemonize = 1; |
|
struct blind *bl; |
struct blind *bl; |
|
|
static void |
static void |
Line 44 main(int argc, char *argv[]) |
|
Line 43 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) { |
Line 82 main(int argc, char *argv[]) |
|
Line 82 main(int argc, char *argv[]) |
|
|
|
if (verbose) { |
if (verbose) { |
bl->bl_opt |= verbose; |
bl->bl_opt |= verbose; |
log_setv(verbose); |
log_set(verbose); |
log_debug("verbose mode on"); |
log_debug("verbose mode on"); |
} |
} |
|
|
Line 90 main(int argc, char *argv[]) |
|
Line 90 main(int argc, char *argv[]) |
|
log_fatal("file name exceeds PATH_MAX"); |
log_fatal("file name exceeds PATH_MAX"); |
|
|
if (config_load(bl)) |
if (config_load(bl)) |
log_fatal("config %s", bl->bl_conf); |
log_fatal("%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); |
|
|
|
// TAILQ_INIT(&offline_queue) |
// to be continued |
|
|
// fork + process setup + communication setup |
free(bl); |
|
|
exit(0); |
exit(0); |
} |
} |