mirror of
https://github.com/tuxbox-neutrino/libstb-hal.git
synced 2025-08-27 07:23:11 +02:00
fix generic
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
* determine the capabilities of the hardware.
|
* determine the capabilities of the hardware.
|
||||||
* part of libstb-hal
|
* part of libstb-hal
|
||||||
*
|
*
|
||||||
* (C) 2010-2012 Stefan Seyfried
|
* (C) 2010-2012,2016 Stefan Seyfried
|
||||||
*
|
*
|
||||||
* License: GPL v2 or later
|
* License: GPL v2 or later
|
||||||
*/
|
*/
|
||||||
@@ -14,12 +14,14 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <hardware_caps.h>
|
#include <hardware_caps.h>
|
||||||
|
#include <sys/utsname.h>
|
||||||
|
|
||||||
static int initialized = 0;
|
static int initialized = 0;
|
||||||
static hw_caps_t caps;
|
static hw_caps_t caps;
|
||||||
|
|
||||||
hw_caps_t *get_hwcaps(void)
|
hw_caps_t *get_hwcaps(void)
|
||||||
{
|
{
|
||||||
|
struct utsname u;
|
||||||
if (initialized)
|
if (initialized)
|
||||||
return ∩︀
|
return ∩︀
|
||||||
|
|
||||||
@@ -32,6 +34,10 @@ hw_caps_t *get_hwcaps(void)
|
|||||||
caps.display_xres = 8;
|
caps.display_xres = 8;
|
||||||
strcpy(caps.boxvendor, "Generic");
|
strcpy(caps.boxvendor, "Generic");
|
||||||
strcpy(caps.boxname, "PC");
|
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 ∩︀
|
return ∩︀
|
||||||
}
|
}
|
||||||
|
@@ -50,5 +50,6 @@ void shutdown_td_api()
|
|||||||
lt_info("%s, initialized = %d\n", __func__, (int)initialized);
|
lt_info("%s, initialized = %d\n", __func__, (int)initialized);
|
||||||
if (glfb)
|
if (glfb)
|
||||||
delete glfb;
|
delete glfb;
|
||||||
|
glfb = NULL;
|
||||||
initialized = false;
|
initialized = false;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user