Commit 09d2330e authored by Ondrej Vysocky's avatar Ondrej Vysocky
Browse files

FIX replaced constant with a predefined const variable

parent 2849edf2
......@@ -8,6 +8,7 @@
#include <iomanip>
#include <sys/stat.h>
#include <algorithm>
#include <limits.h>
#ifdef VERBOSE
#define MERIC_INFO std::cout
......
......@@ -96,8 +96,8 @@ public:
{
std::ofstream oFile(dataInfoFileName);
char hostname[50];
gethostname(hostname, 50);
char hostname[HOST_NAME_MAX];
gethostname(hostname, HOST_NAME_MAX);
time_t now_t = time(0);
std::string now_s = std::string(ctime(&now_t));
now_s.pop_back();
......
......@@ -20,8 +20,8 @@ RestClient::Connection* DAVIDE::conn_samples;
void DAVIDE::init()
{
char hostname[50];
gethostname(hostname, 50);
char hostname[HOST_NAME_MAX];
gethostname(hostname, HOST_NAME_MAX);
std::string davideHostname = std::string(hostname);
std::string::iterator it = davideHostname.begin();
while (it != davideHostname.end() && !std::isdigit(*it))
......
......@@ -18,8 +18,8 @@ void JETSON::init() //int rank = 0)
std::cerr << "JETSON energy measurement system ERROR: connection failed\n";
//get name of the file with measurements
char hostname[50];
gethostname(hostname, 50);
char hostname[HOST_NAME_MAX];
gethostname(hostname, HOST_NAME_MAX);
filename = std::string(MERIC_PATH)+"/tools/jetsonMeasurement/"+std::string(hostname)+".csv";
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment