summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2015-01-15 12:17:21 +0100
committerJo-Philipp Wich <jow@openwrt.org>2015-01-15 12:42:09 +0100
commitc48b19bbe127551ffb2b6d02b33ef78865341cfc (patch)
tree016c9f91fa6a5d1322b3c226b27369d0a8c748a7
parent510c2ddc147649811d39c6ba3758b768cfab7b6d (diff)
downloadunitd-c48b19bbe127551ffb2b6d02b33ef78865341cfc.tar
unitd-c48b19bbe127551ffb2b6d02b33ef78865341cfc.zip
system: attempt to parse /proc/device-tree/model
Fallback to /proc/device-tree/model if /tmp/sysinfo/model is not available. Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
-rw-r--r--system.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/system.c b/system.c
index 1e88b5d..cdb5434 100644
--- a/system.c
+++ b/system.c
@@ -78,7 +78,8 @@ static int system_board(struct ubus_context *ctx, struct ubus_object *obj,
fclose(f);
}
- if ((f = fopen("/tmp/sysinfo/model", "r")) != NULL)
+ if ((f = fopen("/tmp/sysinfo/model", "r")) != NULL ||
+ (f = fopen("/proc/device-tree/model", "r")) != NULL)
{
if (fgets(line, sizeof(line), f))
{