summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYousong Zhou <yszhou4tech@gmail.com>2013-07-23 10:28:41 +0200
committerJohn Crispin <blogic@openwrt.org>2013-07-23 12:24:31 +0200
commit600a9c0d2b74b113fe032ff15e77f0bd4790125b (patch)
tree1364e8e34bc7f644a0178ecd5aac0210b3994a99
parentdf1b0c3512fe6af3724536b45f07fb86ad166585 (diff)
downloadunitd-600a9c0d2b74b113fe032ff15e77f0bd4790125b.tar
unitd-600a9c0d2b74b113fe032ff15e77f0bd4790125b.zip
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 <yszhou4tech@gmail.com>
-rw-r--r--early.c6
1 files changed, 4 insertions, 2 deletions
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) {