{
char **argv;
size_t argc = 1;
- for(struct component *i = $2; i; i = i->next) {
+ struct component *i, *j;
+ for(i = $2; i; i = i->next) {
argc++;
}
argv = region_alloc_zero(
cfg_parser->opt->region, (argc + 1) * sizeof(char *));
argc = 0;
argv[argc++] = $1;
- for(struct component *j, *i = $2; i; i = j) {
+ for(i = $2; i; i = j) {
j = i->next;
argv[argc++] = i->str;
region_recycle(cfg_parser->opt->region, i, sizeof(*i));
}
}
if(pat->verifier) {
+ char *const *s;
printf("\tverifier:");
- for(char *const *s = pat->verifier; *s; s++) {
+ for(s = pat->verifier; *s; s++) {
printf(" \"%s\"", *s);
}
printf("\n");
printf("\tport: %s\n", opt->verify_port);
printf("\tverify-zones: %s\n", opt->verify_zones?"yes":"no");
if(opt->verifier) {
+ char **s;
printf("\tverifier:");
- for(char **s = opt->verifier; *s; s++) {
+ for(s = opt->verifier; *s; s++) {
printf(" \"%s\"", *s);
}
printf("\n");
size_t size = 0;
struct event cmd_event, signal_event, exit_event;
struct zone *zone;
+ size_t i;
assert(nsd != NULL);
fcntl(nsd->verifier_pipe[1], F_SETFD, FD_CLOEXEC);
nsd->verifiers = region_alloc_zero(nsd->server_region, size);
- for(size_t i = 0; i < nsd->verifier_limit; i++) {
+ for(i = 0; i < nsd->verifier_limit; i++) {
nsd->verifiers[i].nsd = nsd;
nsd->verifiers[i].zone = NULL;
nsd->verifiers[i].pid = -1;
}
memset(msgs, 0, sizeof(msgs));
- for (int i = 0; i < NUM_RECV_PER_SELECT; i++) {
+ for (i = 0; i < NUM_RECV_PER_SELECT; i++) {
queries[i] = query_create(nsd->server_region,
compressed_dname_offsets,
compression_table_size, compressed_dnames);
msgs[i].msg_hdr.msg_namelen = queries[i]->addrlen;
}
- for (size_t i = 0; i < nsd->verify_ifs; i++) {
+ for (i = 0; i < nsd->verify_ifs; i++) {
struct udp_handler_data *data;
data = region_alloc_zero(
nsd->server_region, sizeof(*data));
tcp_accept_handlers = region_alloc_array(nsd->server_region,
nsd->verify_ifs, sizeof(*tcp_accept_handlers));
- for (size_t i = 0; i < nsd->verify_ifs; i++) {
+ for (i = 0; i < nsd->verify_ifs; i++) {
struct tcp_accept_handler_data *data;
data = &tcp_accept_handlers[i];
memset(data, 0, sizeof(*data));
pid_t pid;
struct nsd *nsd;
char buf[1];
+ size_t i;
assert(event & EV_READ);
assert(arg != NULL);
{
struct verifier *verifier = NULL;
- for(size_t i = 0; !verifier && i < nsd->verifier_limit; i++) {
+ for(i = 0; !verifier && i < nsd->verifier_limit; i++) {
if(nsd->verifiers[i].zone != NULL &&
nsd->verifiers[i].pid == pid)
{
struct nsd *nsd = (struct nsd *)arg;
int len;
sig_atomic_t mode;
+ size_t i;
assert(nsd != NULL);
assert(event & (EV_READ
}
/* kill verifiers, processes reaped elsewhere */
- for(size_t i = 0; i < nsd->verifier_limit; i++) {
+ for(i = 0; i < nsd->verifier_limit; i++) {
if(nsd->verifiers[i].zone != NULL) {
kill_verifier(&nsd->verifiers[i]);
}
char **command;
FILE *fin;
int fdin, fderr, fdout, flags;
+ size_t i;
assert(nsd != NULL);
assert(nsd->verifier_count < nsd->verifier_limit);
fdin = fdout = fderr = -1;
/* search for available verifier slot */
- for(size_t i = 0; i < nsd->verifier_limit && !verifier; i++) {
+ for(i = 0; i < nsd->verifier_limit && !verifier; i++) {
if(nsd->verifiers[i].zone == NULL) {
verifier = &nsd->verifiers[i];
}