get rid of perror() calls, use ERROR() instead
authorFelix Fietkau <nbd@openwrt.org>
Sat, 16 Mar 2013 01:33:25 +0000 (02:33 +0100)
committerFelix Fietkau <nbd@openwrt.org>
Sat, 16 Mar 2013 01:33:25 +0000 (02:33 +0100)
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
hotplug.c
mkdev.c
watchdog.c

index 6583de46b0409273c8f194eeade4a3a295eba374..ac54da4a3f3a05ab9c8448a4666a47a768ba00ac 100644 (file)
--- 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 c502f70581792187091255a08a9016816f700c17..d50793992a9d1885a79d506154be171e28e09d62 100644 (file)
--- 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;
index 98961d32bb1d9fa5bdd093cdf2c27d134916dc2b..0ba8f25f0ea1423f6e897aecff384e3735cbf381 100644 (file)
@@ -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);
 }