}
}
-void
+int
levent_iface_subscribe(struct lldpd *cfg, int socket)
{
log_debug("event", "subscribe to interface changes from socket %d",
if (cfg->g_iface_event == NULL) {
log_warnx("event",
"unable to allocate a new event for interface changes");
- return;
+ return -1;
}
if (event_add(cfg->g_iface_event, NULL) == -1) {
log_warnx("event",
"unable to schedule new interface changes event");
event_free(cfg->g_iface_event);
cfg->g_iface_event = NULL;
- return;
+ return -1;
}
+ return 0;
}
static void
log_warnx("interfaces", "unable to subscribe to netlink notifications");
goto end;
}
- levent_iface_subscribe(cfg, s);
+ if (levent_iface_subscribe(cfg, s) == -1)
+ close(s);
}
end:
void levent_hardware_release(struct lldpd_hardware *);
void levent_ctl_notify(char *, int, struct lldpd_port *);
void levent_send_now(struct lldpd *);
-void levent_iface_subscribe(struct lldpd *, int);
+int levent_iface_subscribe(struct lldpd *, int);
void levent_schedule_pdu(struct lldpd_hardware *);
/* lldp.c */