diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2015-01-15 12:17:21 +0100 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2015-01-15 12:42:09 +0100 |
commit | c48b19bbe127551ffb2b6d02b33ef78865341cfc (patch) | |
tree | 016c9f91fa6a5d1322b3c226b27369d0a8c748a7 | |
parent | 510c2ddc147649811d39c6ba3758b768cfab7b6d (diff) | |
download | unitd-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.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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)) { |