mirror of
https://github.com/CalcProgrammer1/OpenRGB.git
synced 2026-05-14 09:34:39 -04:00
Adding failure logging to DMI info
This commit is contained in:
5
dependencies/dmiinfo.cpp
vendored
5
dependencies/dmiinfo.cpp
vendored
@@ -8,6 +8,7 @@
|
||||
\*-------------------------------------------------------------------*/
|
||||
|
||||
#include "dmiinfo.h"
|
||||
#include "LogManager.h"
|
||||
|
||||
#ifdef WIN32
|
||||
#include "wmi.h"
|
||||
@@ -35,6 +36,7 @@ DMIInfo::DMIInfo()
|
||||
|
||||
if (hres)
|
||||
{
|
||||
LOG_DEBUG("[DMI Info] Unable to read from %s", WMI);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -62,7 +64,10 @@ DMIInfo::DMIInfo()
|
||||
manufacturer = "";
|
||||
|
||||
if ((access(SYSFSDMI "/board_vendor", R_OK)!=0) && (access(SYSFSDMI "/board_name", R_OK)!=0))
|
||||
{
|
||||
LOG_DEBUG("[DMI Info] Unable to read from %s", SYSFSDMI);
|
||||
return;
|
||||
}
|
||||
|
||||
std::ifstream mftr(SYSFSDMI "/board_vendor", std::ifstream::in);
|
||||
getline(mftr, manufacturer);
|
||||
|
||||
2
dependencies/dmiinfo.h
vendored
2
dependencies/dmiinfo.h
vendored
@@ -14,6 +14,8 @@
|
||||
|
||||
#ifdef WIN32
|
||||
#include "wmi.h"
|
||||
|
||||
#define WMI "WMI"
|
||||
#else
|
||||
#include <unistd.h> //Linux specific filesystem operation
|
||||
#include <fstream>
|
||||
|
||||
Reference in New Issue
Block a user