Changeset 229 for Chief


Ignore:
Timestamp:
06/24/10 07:51:15 (15 years ago)
Author:
ogrimm
Message:
Config requests non-blocking if not made from main thread, adapted all servers to GetConfig() returning std::string, workaround for erroneous SERVICE_LIST
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Chief/Chief.cc

    r218 r229  
    1414#define SERVER_NAME "Chief"
    1515#include "Evidence.h"
     16
     17using namespace std;
    1618
    1719// ========= Class Declarations =========
     
    3840       
    3941        DimService *LastRunNumber;
    40         char *RunNumFilename;
     42        string RunNumFilename;
    4143        int RunNumber;
    4244};
     
    7072 
    7173  // Open file containing last run number
    72   FILE *RunNumFile = fopen(Chief->RunNumFilename, "r+");
     74  FILE *RunNumFile = fopen(Chief->RunNumFilename.c_str(), "r+");
    7375  if(RunNumFile == NULL) {
    74     Chief->Message(Chief->ERROR, "Could not open file '%s' that contains the last run number (%s)", Chief->RunNumFilename, strerror(errno));
     76    Chief->Message(Chief->ERROR, "Could not open file '%s' that contains the last run number (%s)", Chief->RunNumFilename.c_str(), strerror(errno));
    7577        OK = false;
    7678  }
     
    7880        // Read last run number
    7981        if(fscanf(RunNumFile,"%d", &RunNumber) != 1 ) {
    80       Chief->Message(Chief->ERROR, "Could not read run number from file '%s'", Chief->RunNumFilename);
     82      Chief->Message(Chief->ERROR, "Could not read run number from file '%s'", Chief->RunNumFilename.c_str());
    8183          OK = false;
    8284        }
     
    8688        rewind(RunNumFile);
    8789        if(OK && fprintf(RunNumFile,"%.8u   ",RunNumber) < 0) {
    88       Chief->Message(Chief->ERROR, "Could not write to run number file '%s'", Chief->RunNumFilename);
     90      Chief->Message(Chief->ERROR, "Could not write to run number file '%s'", Chief->RunNumFilename.c_str());
    8991          OK = false;
    9092        }
     
    9294        // Close run number file
    9395        if(fclose(RunNumFile) != 0) {
    94       Chief->Message(Chief->ERROR, "Could not close run number file '%s'", Chief->RunNumFilename);
     96      Chief->Message(Chief->ERROR, "Could not close run number file '%s'", Chief->RunNumFilename.c_str());
    9597          OK = false;
    9698        }
Note: See TracChangeset for help on using the changeset viewer.