Changeset 151 for Evidence/DColl.cc
- Timestamp:
- 01/18/10 13:10:57 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Evidence/DColl.cc
r145 r151 49 49 50 50 unsigned int NumItems; 51 char *Filename; 51 52 FILE *DataFile; 52 53 FILE *LogFile; … … 54 55 int DataSizeLastUpdate, LogSizeLastUpdate; 55 56 char *DataDir; 56 DimService *LogSizeService, *DataSizeService ;57 DimService *LogSizeService, *DataSizeService, *DataFilename; 57 58 int HistSize; 58 59 int SizeUpdateDelay; … … 79 80 80 81 // Initialization to prevent freeing unallocated memory 82 Filename = NULL; 81 83 DataFile = NULL; 82 84 LogFile = NULL; … … 105 107 LogCommand = new DimCommand("DColl/Log", (char *) "C", this); 106 108 107 // Create services for file sizes 109 // Create services for file sizes and data file name 108 110 DataSizekB = 0; 109 111 DataSizeService = new DimService(SERVER_NAME "/DataSizekB", DataSizekB); … … 111 113 LogSizekB = FileSize(LogFile); 112 114 LogSizeService = new DimService(SERVER_NAME "/LogSizekB", LogSizekB); 115 116 DataFilename = new DimService(SERVER_NAME "/CurrentFile", (char *) ""); 113 117 114 118 // Count how many minimum change value regular expressions are present … … 162 166 free(List); 163 167 168 delete DataFilename; 164 169 //delete LogSizeService; // These create segmentation faults?! 165 170 //delete DataSizeService; 166 171 167 172 delete LogCommand; 173 free(Filename); 168 174 169 175 // Close files … … 243 249 if (mktime(T) == -1) State(ERROR, "mktime() failed, check filename"); 244 250 245 char *Filename;251 free(Filename); 246 252 if (MakeString(&Filename, "%s/%d%02d%02d.slow", DataDir, T->tm_year+1900, T->tm_mon+1, T->tm_mday) == -1) State(FATAL, "Could not create filename, MakeString() failed"); 247 253 if ((DataFile = fopen(Filename, "a")) == NULL) { … … 249 255 } 250 256 else State(INFO, "Opened data file '%s'", Filename); 251 free(Filename);257 DataFilename->updateService(Filename); 252 258 253 259 // Calculate time for next file opening
Note:
See TracChangeset
for help on using the changeset viewer.