/*--------------------------------------------------------------------*/
static int
-vbe_sock_conn(struct addrinfo *ai)
+vbe_sock_conn(const struct addrinfo *ai)
{
int s;
if (s < 0)
return (s);
else if (connect(s, ai->ai_addr, ai->ai_addrlen)) {
- close(s);
+ AZ(close(s));
s = -1;
}
return (s);
*/
static void
-vbe_rdp(int fd, short event __unused, void *arg __unused)
+vbe_rdp(int fd, short event, void *arg)
{
struct vbe_conn *vc;
int i;
+ (void)event;
+ (void)arg;
i = read(fd, &vc, sizeof vc);
assert(i == sizeof vc);
AZ(pthread_mutex_lock(&vbemtx));
vbe_delete_conn(vc);
} else {
vc->inuse = 0;
- event_add(&vc->ev, NULL);
+ AZ(event_add(&vc->ev, NULL));
TAILQ_INSERT_HEAD(&vc->vbe->fconn, vc, list);
}
AZ(pthread_mutex_unlock(&vbemtx));
*/
static void
-vbe_rdf(int fd __unused, short event __unused, void *arg)
+vbe_rdf(int fd, short event, void *arg)
{
struct vbe_conn *vc;
int j;
+ (void)fd;
+ (void)event;
vc = arg;
AZ(pthread_mutex_lock(&vbemtx));
if (vc->inuse) {
- event_del(&vc->ev);
+ AZ(event_del(&vc->ev));
AZ(pthread_mutex_unlock(&vbemtx));
return;
}
VSL(SLT_BackendClose, vc->fd, "Remote (%d chars)", j);
TAILQ_REMOVE(&vc->vbe->fconn, vc, list);
AZ(pthread_mutex_unlock(&vbemtx));
- event_del(&vc->ev);
- close(vc->fd);
+ AZ(event_del(&vc->ev));
+ AZ(close(vc->fd));
vbe_delete_conn(vc);
}
/* Backend monitoring thread -----------------------------------------*/
static void *
-vbe_main(void *priv __unused)
+vbe_main(void *priv)
{
struct event pev;
+ (void)priv;
vbe_evb = event_init();
assert(vbe_evb != NULL);
memset(&pev, 0, sizeof pev);
event_set(&pev, vbe_pipe[0], EV_READ | EV_PERSIST, vbe_rdp, NULL);
- event_base_set(vbe_evb, &pev);
- event_add(&pev, NULL);
+ AZ(event_base_set(vbe_evb, &pev));
+ AZ(event_add(&pev, NULL));
- event_base_loop(vbe_evb, 0);
+ AZ(event_base_loop(vbe_evb, 0));
- assert(__LINE__ == 0);
- return (NULL);
+ INCOMPL();
}
/* Get a backend connection ------------------------------------------
VSL_stats->backend_conn++;
event_set(&vc->ev, vc->fd,
EV_READ | EV_PERSIST, vbe_rdf, vc);
- event_base_set(vbe_evb, &vc->ev);
+ AZ(event_base_set(vbe_evb, &vc->ev));
}
VSL(SLT_BackendXID, vc->fd, "%u", xid);
return (vc);
{
int i;
+ assert(vc->fd >= 0);
VSL(SLT_BackendClose, vc->fd, "");
- close(vc->fd);
+ AZ(close(vc->fd));
vc->fd = -1;
i = write(vbe_pipe[1], &vc, sizeof vc);
assert(i == sizeof vc);