Changeset 5580

Show
Ignore:
Timestamp:
01/08/09 12:01:41 (5 years ago)
Author:
khali
Message:

Don't bail out on transient errors (#2330).

Location:
lm-sensors/branches/lm-sensors-3.0.0
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • lm-sensors/branches/lm-sensors-3.0.0/CHANGES

    r5563 r5580  
    77  maxilife scripts: Delete (driver never ported to Linux 2.6) 
    88  sensord: Accept negative temperatures in RRD database 
     9           Don't bail out on transient errors (#2330) 
    910  sensors: Add support for instantaneous power sensors 
    1011           Add support for current sensors 
  • lm-sensors/branches/lm-sensors-3.0.0/prog/sensord/sensord.c

    r5163 r5580  
    9191  sensorLog (LOG_INFO, "sensord started"); 
    9292 
    93   while (!done && (ret == 0)) { 
     93  while (!done) { 
    9494    if (reload) { 
    9595      ret = reloadLib (sensorsCfgFile); 
     96      if (ret) 
     97        sensorLog (LOG_NOTICE, "config reload error (%d)", ret); 
    9698      reload = 0; 
    9799    } 
    98     if ((ret == 0) && scanTime) { /* should I scan on the read cycle? */ 
    99       ret = scanChips (); 
    100       if (scanValue <= 0) 
    101         scanValue += scanTime; 
    102     } 
    103     if ((ret == 0) && logTime && (logValue <= 0)) { 
    104       ret = readChips (); 
     100    if (scanTime && (scanValue <= 0)) { 
     101      if ((ret = scanChips ())) 
     102        sensorLog (LOG_NOTICE, "sensor scan error (%d)", ret); 
     103      scanValue += scanTime; 
     104    } 
     105    if (logTime && (logValue <= 0)) { 
     106      if ((ret = readChips ())) 
     107        sensorLog (LOG_NOTICE, "sensor read error (%d)", ret); 
    105108      logValue += logTime; 
    106109    } 
    107     if ((ret == 0) && rrdTime && rrdFile && (rrdValue <= 0)) { 
    108       ret = rrdUpdate (); 
     110    if (rrdTime && rrdFile && (rrdValue <= 0)) { 
     111      if ((ret = rrdUpdate ())) 
     112        sensorLog (LOG_NOTICE, "rrd update error (%d)", ret); 
    109113      /* 
    110114       * The amount of time to wait is computed using the same method as 
     
    113117      rrdValue = rrdTime - time(NULL) % rrdTime; 
    114118    } 
    115     if (!done && (ret == 0)) { 
     119    if (!done) { 
    116120      int a = logTime ? logValue : INT_MAX; 
    117121      int b = scanTime ? scanValue : INT_MAX; 
     
    125129  } 
    126130 
    127   if (ret) 
    128     sensorLog (LOG_INFO, "sensord failed (%d)", ret); 
    129   else 
    130     sensorLog (LOG_INFO, "sensord stopped"); 
     131  sensorLog (LOG_INFO, "sensord stopped"); 
    131132 
    132133  return ret;