Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions camerad/archon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1340,7 +1340,7 @@ namespace Archon {
*
*/
long Interface::load_acf(std::string acffile) {
std::string function = "Archon::Interface::load_acf";
const std::string function("Archon::Interface::load_acf");
std::stringstream message;
std::fstream filestream; // I/O stream class
std::string line; // the line read from the acffile
Expand Down Expand Up @@ -1750,11 +1750,13 @@ namespace Archon {
logwrite(function, "loaded Archon config file OK");
this->firmwareloaded = true;

// add to systemkeys keyword database
// add firmware filename and checksum to systemkeys keyword database
//
std::stringstream keystr;
keystr << "FIRMWARE=" << acffile << "// controller firmware";
this->systemkeys.addkey( keystr.str() );
this->systemkeys.addkey( "FIRMWARE=" + acffile + "// controller firmware" );

std::string hash;
md5_file( acffile, hash );
this->systemkeys.addkey( "FIRM_MD5=" + hash + "// MD5 checksum of firmware" );
}

// If there was an Archon error then read the Archon error log
Expand Down
7 changes: 1 addition & 6 deletions utils/utilities.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -747,13 +747,9 @@ long md5_file(const std::string &filename, std::string &hash) {
}

instream.close();
} catch (std::ifstream::failure &e) {
std::cerr << "md5_file( " << filename << " ): " << e.what() << "\n";
hash = "ERROR";
return 1;
}
catch (std::exception &e) {
std::cerr << "md5_file( " << filename << " ): " << e.what() << "\n";
std::cerr << "ERROR md5_file( " << filename << " ): " << e.what() << "\n";
hash = "ERROR";
return 1;
}
Expand All @@ -772,7 +768,6 @@ long md5_file(const std::string &filename, std::string &hash) {

return 0;
}

/***** md5_file *************************************************************/


Expand Down