}
if (connect(s, (void *)&ss, alen) != 0) {
- close(s);
+ AZ(close(s));
LOCK(&sp->backend->mtx);
return (-1);
}
for (n = 1; n < 5; n++) {
vc = bes_nextfd(sp);
if (vc == NULL) {
- usleep(100000 * n);
+ AZ(usleep(100000 * n));
continue;
}
assert(vc->fd >= 0);
break;
TAILQ_REMOVE(&bes->connlist, vbe, list);
if (vbe->fd >= 0)
- close(vbe->fd);
+ AZ(close(vbe->fd));
FREE_OBJ(vbe);
}
FREE_OBJ(bes);
ww.wlp = ww.wlog;
ww.wle = ww.wlog + sizeof ww.wlog;
- sleep(10); /* Takes time for VCL to arrive */
+ AZ(sleep(10)); /* XXX: Takes time for VCL to arrive */
VCL_Get(&sp->vcl);
t = TIM_real();
while (1) {
i = read(fds[idx].fd, buf, sizeof buf);
if (i <= 0 || fds[1-idx].events == 0) {
- shutdown(fds[idx].fd, SHUT_RD);
- shutdown(fds[1-idx].fd, SHUT_WR);
+ AZ(shutdown(fds[idx].fd, SHUT_RD));
+ AZ(shutdown(fds[1-idx].fd, SHUT_WR));
fds[idx].events = 0;
return;
}
for (p = buf; i > 0; i -= j, p += j) {
j = write(fds[1-idx].fd, p, i);
if (j != i) {
- shutdown(fds[idx].fd, SHUT_WR);
- shutdown(fds[1-idx].fd, SHUT_RD);
+ AZ(shutdown(fds[idx].fd, SHUT_WR));
+ AZ(shutdown(fds[1-idx].fd, SHUT_RD));
fds[1-idx].events = 0;
return;
}
cli_close:
vsb_delete(cp->cli->sb);
free(cp->buf);
- close(cp->fdi);
+ AZ(close(cp->fdi));
if (cp->fdi == 0)
- open("/dev/null", O_RDONLY);
- close(cp->fdo);
+ assert(open("/dev/null", O_RDONLY) == 0);
+ AZ(close(cp->fdo));
if (cp->fdo == 1) {
+ assert(open("/dev/null", O_WRONLY) == 1);
close(2);
- open("/dev/null", O_WRONLY);
- open("/dev/null", O_WRONLY);
+ assert(open("/dev/null", O_WRONLY) == 2);
}
free(cp);
return (1);
vsb_printf(sb,
"Write error to C source file: %s\n",
strerror(errno));
- unlink(sf);
- fclose(fs);
+ AZ(unlink(sf));
+ AZ(fclose(fs));
return (NULL);
}
rewind(fs);
"\tcommand attempted: %s\n",
strerror(errno), vsb_data(cccmd));
free(of);
- unlink(sf);
- fclose(fs);
+ AZ(unlink(sf));
+ AZ(fclose(fs));
vsb_delete(cccmd);
return (NULL);
}
i = pclose(fo);
- unlink(sf);
- fclose(fs);
+ AZ(unlink(sf));
+ AZ(fclose(fs));
if (j == 0 && i != 0) {
vsb_printf(sb,
/* If the compiler complained, or exited non-zero, fail */
if (i || j) {
- unlink(of);
+ AZ(unlink(of));
free(of);
return (NULL);
}
if (p == NULL) {
vsb_printf(sb, "Problem loading compiled VCL program:\n\t%s\n",
dlerror());
- unlink(of);
+ AZ(unlink(of));
free(of);
return (NULL);
}
- (void)dlclose(p);
+ AZ(dlclose(p));
return (of);
}
vp = calloc(sizeof *vp, 1);
XXXAN(vp);
vp->name = strdup(name);
+ XXXAN(vp->name);
vp->fname = file;
TAILQ_INSERT_TAIL(&vclhead, vp, list);
return (vp);