make config structure pointer global

This commit is contained in:
Sergey Popov 2011-11-25 17:50:47 +04:00
parent 4aa37602ec
commit cacb7c46e3

View File

@ -22,6 +22,7 @@ typedef struct {
int fail_count; // how many times in a row host was unreachable
} host_decl;
cfg_t *cfg; // pointer to configuration structure
host_decl* hosts=NULL; // structure with hosts' definitions
int hosts_count=0; // count of hosts
int debug_flag=0;
@ -55,7 +56,6 @@ void init()
CFG_SIMPLE_INT("debug", &debug_flag),
CFG_END()
};
cfg_t *cfg;
cfg = cfg_init(opts, CFGF_NONE);
// check if config file is valid and parse it
if (cfg_parse(cfg, "/etc/yasnd.conf") == CFG_PARSE_ERROR)