From: Yousong Zhou Date: Tue, 23 Jul 2013 08:28:41 +0000 (+0800) Subject: Error and return when failing stat('/dev/console'). X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fprocd.git;a=commitdiff_plain;h=600a9c0d2b74b113fe032ff15e77f0bd4790125b Error and return when failing stat('/dev/console'). 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 --- diff --git a/early.c b/early.c index f9e3277..e86e4dd 100644 --- 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) {