Ignore:
Timestamp:
01/11/11 12:06:18 (14 years ago)
Author:
ogrimm
Message:
Small changes to limit error messages in case crate communication breaks
File:
1 edited

Legend:

Unmodified
Added
Removed
  • fact/BIASctrl/Crate.cc

    r10070 r10096  
    119119  // === Lock device ===
    120120  flockfile(File);
    121  
     121
     122  // Do not try to communicate if crate has too many errors
     123  if (ErrorCount > MAX_ERR_COUNT) goto ExitCommunicate;
     124
    122125  // === Write data ===
    123126  if ((N = write(fDescriptor, Buf.data(), Buf.size())) < (int) Buf.size()) {
     
    125128    else m->Message(m->ERROR, "Could write only %d of %d bytes to board", N, Buf.size());
    126129    ErrorCount++;
    127         goto ExitCommunicate;
     130       
    128131  }
    129132
     
    132135        FD_ZERO(&SelectDescriptor);   FD_SET(fDescriptor, &SelectDescriptor);
    133136        if (select(fDescriptor+1, &SelectDescriptor, NULL, NULL, &WaitTime)==-1) {
    134       m->Message(m->ERROR, "Error with select() (%s)", strerror(errno));
    135           goto ExitCommunicate;
     137      m->Message(m->FATAL, "Error with select() (%s)", strerror(errno));
    136138        }
    137139
Note: See TracChangeset for help on using the changeset viewer.