Changeset 4709

Show
Ignore:
Timestamp:
08/26/07 13:45:46 (7 years ago)
Author:
khali
Message:

libsensors no longer returns ignored features so no need to check for
this in applications anymore.

Location:
lm-sensors/branches/lm-sensors-3.0.0/prog/sensord
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • lm-sensors/branches/lm-sensors-3.0.0/prog/sensord/rrd.c

    r4701 r4709  
    156156          const char *rawLabel = NULL; 
    157157          char *label = NULL; 
    158           int valid = 0; 
    159           if (getValid (chip, labelNumber, &valid)) { 
    160             sensorLog (LOG_ERR, "Error getting sensor validity: %s/#%d", chip->prefix, labelNumber); 
    161             ret = -1; 
    162           } else if (getRawLabel (chip, labelNumber, &rawLabel)) { 
     158 
     159          if (getRawLabel (chip, labelNumber, &rawLabel)) { 
    163160            sensorLog (LOG_ERR, "Error getting raw sensor label: %s/#%d", chip->prefix, labelNumber); 
    164161            ret = -1; 
     
    166163            sensorLog (LOG_ERR, "Error getting sensor label: %s/#%d", chip->prefix, labelNumber); 
    167164            ret = -1; 
    168           } else if (valid) { 
     165          } else { 
    169166            rrdCheckLabel (rawLabel, num); 
    170167            ret = fn (data, rrdLabels[num], label, feature); 
  • lm-sensors/branches/lm-sensors-3.0.0/prog/sensord/sense.c

    r4701 r4709  
    3333#define DO_SET 2 
    3434#define DO_RRD 3 
    35  
    36 int 
    37 getValid 
    38 (const sensors_chip_name *name, int feature, int *valid) { 
    39   int err; 
    40   err = sensors_get_ignored (name, feature); 
    41   if (err >= 0) { 
    42     *valid = err; 
    43     err = 0; 
    44   } 
    45   return err; 
    46 } 
    4735 
    4836int 
     
    9684  while ((ret == 0) && ((sensor = sensors_get_all_features (chip, &index0, &index1)) != NULL)) { 
    9785    char *label = NULL; 
    98     int valid = 0; 
    9986    double value; 
    10087     
    101     if (getValid (chip, sensor->number, &valid)) { 
    102       sensorLog (LOG_ERR, "Error getting sensor validity: %s/%s", chip->prefix, sensor->name); 
    103       ret = 20; 
    104     } else if (!(label = sensors_get_label (chip, sensor->number))) { 
     88    if (!(label = sensors_get_label (chip, sensor->number))) { 
    10589      sensorLog (LOG_ERR, "Error getting sensor label: %s/%s", chip->prefix, sensor->name); 
    10690      ret = 21; 
    107     } else if (!valid) { 
    108       /* skip invalid */ 
    10991    } else if (!(sensor->mode & SENSORS_MODE_R)) { 
    11092      sensorLog (LOG_INFO, "%s: %s", sensor->name, label); 
     
    155137    int beep = beeps & feature->beepMask; 
    156138    char *label = NULL; 
    157     int valid = 0; 
    158139 
    159140    if ((action == DO_SCAN) && !alarm) { 
    160141      continue; 
    161     } else if (getValid (chip, labelNumber, &valid)) { 
    162       sensorLog (LOG_ERR, "Error getting sensor validity: %s/#%d", chip->prefix, labelNumber); 
    163       ret = 22; 
    164142    } else if (!(label = sensors_get_label (chip, labelNumber))) { 
    165143      sensorLog (LOG_ERR, "Error getting sensor label: %s/#%d", chip->prefix, labelNumber); 
    166144      ret = 22; 
    167     } else if (valid) { 
     145    } else { 
    168146      double values[MAX_DATA]; 
    169147 
  • lm-sensors/branches/lm-sensors-3.0.0/prog/sensord/sensord.h

    r4694 r4709  
    5959/* from sense.c */ 
    6060 
    61 extern int getValid (const sensors_chip_name *name, int feature, int *valid); 
    6261extern int getRawLabel (const sensors_chip_name *name, int feature, const char **label); 
    6362