fix generic

This commit is contained in:
TangoCash
2017-03-10 21:49:33 +01:00
parent ae3cc86f0b
commit 5628130216
2 changed files with 8 additions and 1 deletions

View File

@@ -2,7 +2,7 @@
* determine the capabilities of the hardware.
* part of libstb-hal
*
* (C) 2010-2012 Stefan Seyfried
* (C) 2010-2012,2016 Stefan Seyfried
*
* License: GPL v2 or later
*/
@@ -14,12 +14,14 @@
#include <string.h>
#include <unistd.h>
#include <hardware_caps.h>
#include <sys/utsname.h>
static int initialized = 0;
static hw_caps_t caps;
hw_caps_t *get_hwcaps(void)
{
struct utsname u;
if (initialized)
return &caps;
@@ -32,6 +34,10 @@ hw_caps_t *get_hwcaps(void)
caps.display_xres = 8;
strcpy(caps.boxvendor, "Generic");
strcpy(caps.boxname, "PC");
if (! uname(&u))
strncpy(caps.boxarch, u.machine, sizeof(caps.boxarch));
else
fprintf(stderr, "%s: uname() failed: %m\n", __func__);
return &caps;
}

View File

@@ -50,5 +50,6 @@ void shutdown_td_api()
lt_info("%s, initialized = %d\n", __func__, (int)initialized);
if (glfb)
delete glfb;
glfb = NULL;
initialized = false;
}