Signed-off-by: Felix Fietkau <nbd@openwrt.org>
nls.nl_groups = -1;
if ((hotplug_fd.fd = socket(PF_NETLINK, SOCK_DGRAM | SOCK_CLOEXEC, NETLINK_KOBJECT_UEVENT)) == -1) {
- ERROR("Failed to open hotplug socket\n");
- perror("socket");
+ ERROR("Failed to open hotplug socket: %s\n", strerror(errno));
exit(1);
}
if (bind(hotplug_fd.fd, (void *)&nls, sizeof(struct sockaddr_nl))) {
- ERROR("Failed to bind hotplug socket\n");
- perror("socket");
+ ERROR("Failed to bind hotplug socket: %s\n", strerror(errno));
exit(1);
}
{
char *pattern;
- if (chdir("/dev")) {
- perror("chdir");
+ if (chdir("/dev"))
return 1;
- }
pattern = add_pattern(name);
patterns = &pattern;
{
DEBUG(2, "Ping\n");
if (write(wdt_fd, "X", 1) < 0)
- perror("WDT failed to write\n");
+ ERROR("WDT failed to write: %s\n", strerror(errno));
uloop_timeout_set(t, wdt_frequency * 1000);
}