Adding failure logging to DMI info
This commit is contained in:
parent
bc3c1b504b
commit
3d469e78f5
2 changed files with 7 additions and 0 deletions
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>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue