Browse Source

* daemon.c : use jails_{start,stop}()

master
Alex 'AdUser' Z 8 years ago
parent
commit
10ffed4933
  1. 24
      src/daemon.c

24
src/daemon.c

@ -360,24 +360,7 @@ int main(int argc, char *argv[]) {
if (config.defaults) if (config.defaults)
f2b_jail_set_defaults(config.defaults); f2b_jail_set_defaults(config.defaults);
for (section = config.jails; section != NULL; section = section->next) { jails_start(&config);
if ((jail = f2b_jail_create(section)) == NULL) {
f2b_log_msg(log_error, "can't create jail '%s'", section->name);
continue;
}
if (!jail->enabled) {
f2b_log_msg(log_debug, "ignoring disabled jail '%s'", jail->name);
free(jail);
continue;
}
if (!f2b_jail_init(jail, &config)) {
f2b_log_msg(log_error, "can't init jail '%s'", section->name);
free(jail);
continue;
}
jail->next = jails;
jails = jail;
}
f2b_config_free(&config); f2b_config_free(&config);
if (!jails) { if (!jails) {
@ -386,7 +369,7 @@ int main(int argc, char *argv[]) {
} }
while (state) { while (state) {
for (jail = jails; jail != NULL; jail = jail->next) { for (f2b_jail_t *jail = jails; jail != NULL; jail = jail->next) {
f2b_jail_process(jail); f2b_jail_process(jail);
} }
f2b_csocket_poll(opts.csock, f2b_cmsg_process); f2b_csocket_poll(opts.csock, f2b_cmsg_process);
@ -402,8 +385,7 @@ int main(int argc, char *argv[]) {
f2b_csocket_destroy(opts.csock, opts.csocket_path); f2b_csocket_destroy(opts.csock, opts.csocket_path);
for (jail = jails; jail != NULL; jail = jail->next) jails_stop(jails);
f2b_jail_stop(jail);
return EXIT_SUCCESS; return EXIT_SUCCESS;
} }

Loading…
Cancel
Save