Skip to content

Commit

Permalink
cleaned up error message
Browse files Browse the repository at this point in the history
  • Loading branch information
William C Bonner committed Oct 14, 2023
1 parent 66d663d commit 3397212
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ if (POLICY CMP0141)
endif()

project ("influxdbwindsvg"
VERSION 2.20231014.2
VERSION 2.20231014.3
DESCRIPTION "Retrieves Environment Data from Influx Database and creates SVG files"
HOMEPAGE_URL https://github.com/wcbonner/InfluxDBWindSVG
)
Expand Down
12 changes: 4 additions & 8 deletions influxd-wind-svg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -328,12 +328,10 @@ void WriteSVG(std::vector<Influx_Wind>& TheValues, const std::filesystem::path&
int GraphWidth = SVGWidth - (FontSize * 5);
if (!TheValues.empty())
{
struct stat64 SVGStat;
SVGStat.st_mtim.tv_sec = 0;
struct stat64 SVGStat(0);
if (-1 == stat64(SVGFileName.c_str(), &SVGStat))
if (ConsoleVerbosity > 0)
perror(SVGFileName.c_str());
//std::cout << "[" << getTimeISO8601() << "] stat returned error on : " << SVGFileName << std::endl;
std::cout << "[" << getTimeISO8601(true) << "] " << SVGFileName << ": " << std::strerror(errno) << std::endl;
if (TheValues.begin()->Time > SVGStat.st_mtim.tv_sec) // only write the file if we have new data
{
std::ofstream SVGFile(SVGFileName);
Expand Down Expand Up @@ -758,12 +756,10 @@ void WriteSVG(std::vector<Influx_Pressure>& TheValues, const std::filesystem::pa
int GraphWidth = SVGWidth - (FontSize * 5);
if (!TheValues.empty())
{
struct stat64 SVGStat;
SVGStat.st_mtim.tv_sec = 0;
struct stat64 SVGStat(0);
if (-1 == stat64(SVGFileName.c_str(), &SVGStat))
if (ConsoleVerbosity > 0)
perror(SVGFileName.c_str());
//std::cout << "[" << getTimeISO8601() << "] stat returned error on : " << SVGFileName << std::endl;
std::cout << "[" << getTimeISO8601(true) << "] " << SVGFileName << ": " << std::strerror(errno) << std::endl;
if (TheValues.begin()->Time > SVGStat.st_mtim.tv_sec) // only write the file if we have new data
{
std::ofstream SVGFile(SVGFileName);
Expand Down

0 comments on commit 3397212

Please sign in to comment.