Lines Matching refs:cfg

68 static struct hastd_config *cfg;
109 TAILQ_FOREACH_SAFE(tres, &cfg->hc_resources, hr_next, tmres) {
126 TAILQ_REMOVE(&cfg->hc_resources, tres, hr_next);
129 if (cfg->hc_controlin != NULL)
130 proto_close(cfg->hc_controlin);
131 proto_close(cfg->hc_controlconn);
132 while ((lst = TAILQ_FIRST(&cfg->hc_listen)) != NULL) {
133 TAILQ_REMOVE(&cfg->hc_listen, lst, hl_next);
334 TAILQ_FOREACH(res, &cfg->hc_resources, hr_next) {
505 if (strcmp(cfg->hc_controladdr, newcfg->hc_controladdr) != 0) {
519 TAILQ_FOREACH(clst, &cfg->hc_listen, hl_next) {
545 strcmp(cfg->hc_pidfile, newcfg->hc_pidfile) != 0) {
575 cfg->hc_controladdr, newcfg->hc_controladdr);
576 proto_close(cfg->hc_controlconn);
577 cfg->hc_controlconn = newcfg->hc_controlconn;
579 strlcpy(cfg->hc_controladdr, newcfg->hc_controladdr,
580 sizeof(cfg->hc_controladdr));
586 pjdlog_info("Pidfile changed from %s to %s.", cfg->hc_pidfile,
590 (void)strlcpy(cfg->hc_pidfile, newcfg->hc_pidfile,
591 sizeof(cfg->hc_pidfile));
596 while ((clst = TAILQ_FIRST(&cfg->hc_listen)) != NULL) {
606 TAILQ_REMOVE(&cfg->hc_listen, clst, hl_next);
609 TAILQ_CONCAT(&cfg->hc_listen, &newcfg->hc_listen, hl_next);
614 TAILQ_FOREACH_SAFE(cres, &cfg->hc_resources, hr_next, tres) {
621 TAILQ_REMOVE(&cfg->hc_resources, cres, hr_next);
630 TAILQ_FOREACH(cres, &cfg->hc_resources, hr_next) {
636 TAILQ_INSERT_TAIL(&cfg->hc_resources, nres, hr_next);
663 TAILQ_FOREACH(cres, &cfg->hc_resources, hr_next) {
673 TAILQ_REMOVE(&cfg->hc_resources, cres, hr_next);
676 TAILQ_INSERT_TAIL(&cfg->hc_resources, nres, hr_next);
706 TAILQ_FOREACH(clst, &cfg->hc_listen, hl_next) {
731 TAILQ_FOREACH(res, &cfg->hc_resources, hr_next) {
780 TAILQ_FOREACH(res, &cfg->hc_resources, hr_next) {
827 TAILQ_FOREACH(res, &cfg->hc_resources, hr_next) {
1052 proto_close(cfg->hc_controlconn);
1086 maxfd = fd = proto_descriptor(cfg->hc_controlconn);
1089 TAILQ_FOREACH(lst, &cfg->hc_listen, hl_next) {
1097 TAILQ_FOREACH(res, &cfg->hc_resources, hr_next) {
1142 if (FD_ISSET(proto_descriptor(cfg->hc_controlconn), &rfds))
1143 control_handle(cfg);
1144 TAILQ_FOREACH(lst, &cfg->hc_listen, hl_next) {
1150 TAILQ_FOREACH(res, &cfg->hc_resources, hr_next) {
1244 cfg = yy_config_parse(cfgpath, true);
1245 PJDLOG_ASSERT(cfg != NULL);
1248 if (strlcpy(cfg->hc_pidfile, pidfile,
1249 sizeof(cfg->hc_pidfile)) >= sizeof(cfg->hc_pidfile)) {
1255 pfh = pidfile_open(cfg->hc_pidfile, 0600, &otherpid);
1260 cfg->hc_pidfile, (intmax_t)otherpid);
1268 cfg->hc_pidfile);
1293 if (proto_server(cfg->hc_controladdr, &cfg->hc_controlconn) == -1) {
1296 cfg->hc_controladdr);
1299 TAILQ_FOREACH(lst, &cfg->hc_listen, hl_next) {
1321 cfg->hc_pidfile);
1323 pjdlog_debug(1, "PID stored in %s.", cfg->hc_pidfile);
1331 cfg->hc_controladdr);
1332 TAILQ_FOREACH(lst, &cfg->hc_listen, hl_next)