Changeset 28 for drsdaq


Ignore:
Timestamp:
04/02/09 13:40:41 (16 years ago)
Author:
ogrimm
Message:
Check for magic number in RawDataCTX.cc added
Location:
drsdaq
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • drsdaq/History.txt

    r27 r28  
    11111/4/2009    Changes many 'char *' to 'const char *' to honour compiler warning
    1212            on ihp-pc26 (newer version of g++ than on eth-vme02)
     132/4/2009    Intoduced check for magic number in RawDataCTX.cc
  • drsdaq/RawDataCTX.cc

    r22 r28  
    3939  if (fread(RHeader, sizeof(RunHeader), 1, Rawfile) != 1) {
    4040    if(!Silent) printf("Error: Could not read run header\n");
     41    fclose(Rawfile);
     42    return CTX_RHEADER; 
     43  }
     44  // Check magic number of run header
     45  if (RHeader->MagicNum!=MAGICNUM_FILE_OPEN && RHeader->MagicNum!=MAGICNUM_FILE_CLOSED) {
     46    if(!Silent) printf("Error: Magic number of run header incorrect\n");
    4147    fclose(Rawfile);
    4248    return CTX_RHEADER; 
Note: See TracChangeset for help on using the changeset viewer.