Error and return when failing stat('/dev/console').
authorYousong Zhou <yszhou4tech@gmail.com>
Tue, 23 Jul 2013 08:28:41 +0000 (16:28 +0800)
committerJohn Crispin <blogic@openwrt.org>
Tue, 23 Jul 2013 10:24:31 +0000 (12:24 +0200)
Since mkdev("*", 0600) has been called in early_dev just before
early_console, no need to try checking it again.

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
early.c

diff --git a/early.c b/early.c
index f9e3277933fc051e786ca0c4dc6df33e719d4d4c..e86e4dd1ad368907b63705e1e68be60c53d67f9a 100644 (file)
--- a/early.c
+++ b/early.c
@@ -49,8 +49,10 @@ static void early_console(const char *dev)
        struct stat s;
        int dd;
 
-       if (stat(dev, &s))
-               mkdev("*console", 0600);
+       if (stat(dev, &s)) {
+               ERROR("Failed to stat %s\n", dev);
+               return;
+       }
 
        dd = open(dev, O_RDWR);
        if (dd < 0) {