mirror of
https://github.com/tuxbox-neutrino/libstb-hal.git
synced 2025-08-28 07:51:21 +02:00
hardware_caps: add boxarch field
This commit is contained in:
@@ -2,24 +2,23 @@
|
||||
* determine the capabilities of the hardware.
|
||||
* part of libstb-hal
|
||||
*
|
||||
* (C) 2010-2013 Stefan Seyfried
|
||||
* (C) 2010-2013,2016 Stefan Seyfried
|
||||
*
|
||||
* License: GPL v2 or later
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <hardware_caps.h>
|
||||
#include <sys/utsname.h>
|
||||
#include <stdio.h>
|
||||
|
||||
static int initialized = 0;
|
||||
static hw_caps_t caps;
|
||||
|
||||
hw_caps_t *get_hwcaps(void)
|
||||
{
|
||||
struct utsname u;
|
||||
if (initialized)
|
||||
return ∩︀
|
||||
|
||||
@@ -32,6 +31,10 @@ hw_caps_t *get_hwcaps(void)
|
||||
caps.display_xres = 8;
|
||||
strcpy(caps.boxvendor, "Raspberry");
|
||||
strcpy(caps.boxname, "Pi");
|
||||
if (! uname(&u))
|
||||
strncpy(caps.boxarch, u.machine, sizeof(caps.boxarch));
|
||||
else
|
||||
fprintf(stderr, "%s: uname() failed: %m\n", __func__);
|
||||
|
||||
return ∩︀
|
||||
}
|
||||
|
Reference in New Issue
Block a user