Changeset 5793
- Timestamp:
- 11/04/09 20:07:38 (4 years ago)
- Files:
-
- 1 modified
-
lm-sensors/trunk/prog/sensord/rrd.c (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lm-sensors/trunk/prog/sensord/rrd.c
r5792 r5793 69 69 #define LOAD_AVERAGE "Load Average" 70 70 71 typedef int(*FeatureFN) (void *data, const char *rawLabel, const char *label,72 const FeatureDescriptor *feature);71 typedef void (*FeatureFN) (void *data, const char *rawLabel, const char *label, 72 const FeatureDescriptor *feature); 73 73 74 74 static char rrdNextChar(char c) … … 142 142 const ChipDescriptor *desc) 143 143 { 144 int i , ret;144 int i; 145 145 const FeatureDescriptor *features = desc->features; 146 146 const FeatureDescriptor *feature; … … 160 160 161 161 rrdCheckLabel(rawLabel, i); 162 ret =fn(data, rrdLabels[i], label, feature);162 fn(data, rrdLabels[i], label, feature); 163 163 free(label); 164 164 } … … 211 211 }; 212 212 213 static intrrdGetSensors_DS(void *_data, const char *rawLabel,214 const char *label,215 const FeatureDescriptor *feature)213 static void rrdGetSensors_DS(void *_data, const char *rawLabel, 214 const char *label, 215 const FeatureDescriptor *feature) 216 216 { 217 217 (void) label; /* no warning */ … … 248 248 sensord_args.rrdTime, min, max); 249 249 } 250 return 0;251 250 } 252 251 … … 257 256 ret = applyToFeatures(rrdGetSensors_DS, &data); 258 257 if (!ret && sensord_args.doLoad) 259 r et = rrdGetSensors_DS(&data, LOADAVG, LOAD_AVERAGE, NULL);258 rrdGetSensors_DS(&data, LOADAVG, LOAD_AVERAGE, NULL); 260 259 return ret ? -1 : data.num; 261 260 } … … 324 323 }; 325 324 326 static intrrdCGI_DEF(void *_data, const char *rawLabel, const char *label,327 const FeatureDescriptor *feature)325 static void rrdCGI_DEF(void *_data, const char *rawLabel, const char *label, 326 const FeatureDescriptor *feature) 328 327 { 329 328 struct gr *data = _data; … … 332 331 printf("\n\tDEF:%s=%s:%s:AVERAGE", rawLabel, 333 332 sensord_args.rrdFile, rawLabel); 334 return 0;335 333 } 336 334 … … 360 358 } 361 359 362 static intrrdCGI_LINE(void *_data, const char *rawLabel, const char *label,363 const FeatureDescriptor *feature)360 static void rrdCGI_LINE(void *_data, const char *rawLabel, const char *label, 361 const FeatureDescriptor *feature) 364 362 { 365 363 struct gr *data = _data; … … 367 365 printf("\n\tLINE2:%s#%.6x:\"%s\"", rawLabel, 368 366 rrdCGI_color(label), label); 369 return 0;370 367 } 371 368 … … 489 486 ret = applyToFeatures(rrdCGI_DEF, graph); 490 487 if (!ret && sensord_args.doLoad && graph->loadAvg) 491 r et = rrdCGI_DEF(graph, LOADAVG, LOAD_AVERAGE, NULL);488 rrdCGI_DEF(graph, LOADAVG, LOAD_AVERAGE, NULL); 492 489 if (!ret) 493 490 ret = applyToFeatures(rrdCGI_LINE, graph); 494 491 if (!ret && sensord_args.doLoad && graph->loadAvg) 495 r et = rrdCGI_LINE(graph, LOADAVG, LOAD_AVERAGE, NULL);492 rrdCGI_LINE(graph, LOADAVG, LOAD_AVERAGE, NULL); 496 493 printf (">\n</p>\n"); 497 494 }
