From 8e728e62d2c7875dc9291797bff8e19a7340405f Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Sat, 16 Mar 2013 02:33:25 +0100 Subject: [PATCH] get rid of perror() calls, use ERROR() instead Signed-off-by: Felix Fietkau --- hotplug.c | 6 ++---- mkdev.c | 4 +--- watchdog.c | 2 +- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/hotplug.c b/hotplug.c index 6583de4..ac54da4 100644 --- a/hotplug.c +++ b/hotplug.c @@ -422,13 +422,11 @@ void hotplug(char *rules) 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); } diff --git a/mkdev.c b/mkdev.c index c502f70..d507939 100644 --- a/mkdev.c +++ b/mkdev.c @@ -109,10 +109,8 @@ int mkdev(const char *name, int _mode) { char *pattern; - if (chdir("/dev")) { - perror("chdir"); + if (chdir("/dev")) return 1; - } pattern = add_pattern(name); patterns = &pattern; diff --git a/watchdog.c b/watchdog.c index 98961d3..0ba8f25 100644 --- a/watchdog.c +++ b/watchdog.c @@ -36,7 +36,7 @@ static void watchdog_timeout_cb(struct uloop_timeout *t) { 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); } -- 2.11.0