Commit d4bf533f authored by Graziano Scalamera's avatar Graziano Scalamera
Browse files

Fix bug opening label file

parent c5b5b8e3
......@@ -246,9 +246,8 @@ void PLCesall::init_device()
timestamp_last = 0;
// read data filename
// start_file= "/elettra_log/logs/plcll-srv.labels.txt"; //name of the startup file
vector<string>::iterator iter = data_config.begin();
start_file = ((string)*iter).c_str();
start_file = ((string)*iter);
iter++;
/* cout<<"loading srv config from file: "<< start_file <<endl;
load_cond();
......@@ -1151,11 +1150,11 @@ void PLCesall::syncronize()
}
void PLCesall::load_cond(){
fd.open(start_file);
fd.open(start_file.c_str());
char pbuf[128];
if (!fd){
DEBUG_STREAM << "PLCesall::load_cond() cannot open file:" << strerror(errno) << endl;
DEBUG_STREAM << "PLCesall::load_cond() cannot open file ("<<start_file<<"): " << strerror(errno) << endl;
}
else{
DEBUG_STREAM << "PLCesall::load_cond() file opened successfully" << endl;
......
......@@ -1291,7 +1291,7 @@ public :
bool abortflag; // flag used to abort thread loops
int new_sd, sock; // socket for data exchange
ifstream fd; //startup file
const char* start_file;
string start_file;
plcsrvthread *srvloop; //read from socket thread
plclgthread *logloop; //manages the read timeout
......
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