Code Cleanup
- Used File object inside Sensor.
This commit is contained in:
@@ -26,7 +26,8 @@
|
|||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include "Sensor.h"
|
#include <File.h>
|
||||||
|
#include <Sensor.h>
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
Sensor::Sensor ()
|
Sensor::Sensor ()
|
||||||
@@ -83,11 +84,7 @@ void Sensor::fileDeletion (const std::string&)
|
|||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
time_t Sensor::getModification ()
|
time_t Sensor::getModification ()
|
||||||
{
|
{
|
||||||
struct stat s = {0};
|
return File (_file).mtime ();
|
||||||
if (0 == stat (_file.c_str (), &s))
|
|
||||||
return s.st_mtime;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|||||||
Reference in New Issue
Block a user