Changeset 4828 for lm-sensors/branches/lm-sensors-3.0.0/prog/sensord/rrd.c
- Timestamp:
- 09/21/07 14:15:18 (6 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
lm-sensors/branches/lm-sensors-3.0.0/prog/sensord/rrd.c
r4817 r4828 142 142 for (j = 0; (ret == 0) && (j < numChipNames); ++ j) { 143 143 while ((ret == 0) && ((chip = sensors_get_detected_chips (&chipNames[j], &i)) != NULL)) { 144 ChipDescriptor *descriptor; 145 descriptor = generateChipDescriptor (chip); 146 if (descriptor) { 144 int index0, chipindex = -1; 145 for (index0 = 0; knownChips[index0].features; ++ index0) 146 /* Trick: we compare addresses here. We know it works because both 147 pointers were returned by sensors_get_detected_chips(), so they 148 refer to libsensors internal structures, which do not move. */ 149 if (knownChips[index0].name == chip) { 150 chipindex = index0; 151 break; 152 } 153 if (chipindex >= 0) { 154 const ChipDescriptor *descriptor = &knownChips[chipindex]; 147 155 const FeatureDescriptor *features = descriptor->features; 148 int index0;149 156 150 157 for (index0 = 0; (ret == 0) && (num < MAX_RRD_SENSORS) && features[index0].format; ++ index0) { … … 168 175 free (label); 169 176 } 170 free (descriptor->features);171 free (descriptor);172 177 } 173 178 }
