Adding failure logging to DMI info

This commit is contained in:
Chris 2021-12-07 09:57:37 +11:00 committed by Adam Honse
parent bc3c1b504b
commit 3d469e78f5
2 changed files with 7 additions and 0 deletions

View file

@ -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);

View file

@ -14,6 +14,8 @@
#ifdef WIN32
#include "wmi.h"
#define WMI "WMI"
#else
#include <unistd.h> //Linux specific filesystem operation
#include <fstream>