diff options
author | Yousong Zhou <yszhou4tech@gmail.com> | 2013-07-23 10:28:41 +0200 |
---|---|---|
committer | John Crispin <blogic@openwrt.org> | 2013-07-23 12:24:31 +0200 |
commit | 600a9c0d2b74b113fe032ff15e77f0bd4790125b (patch) | |
tree | 1364e8e34bc7f644a0178ecd5aac0210b3994a99 | |
parent | df1b0c3512fe6af3724536b45f07fb86ad166585 (diff) | |
download | unitd-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.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -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) { |