Changeset 2503 for lm-sensors/trunk/prog/sensord/sensord.c
- Timestamp:
- 05/01/04 21:18:53 (9 years ago)
- Files:
-
- 1 modified
-
lm-sensors/trunk/prog/sensord/sensord.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lm-sensors/trunk/prog/sensord/sensord.c
r1389 r2503 29 29 #include <syslog.h> 30 30 #include <unistd.h> 31 #include <time.h> 31 32 #include <sys/types.h> 32 33 #include <sys/stat.h> … … 76 77 (void) { 77 78 int ret = 0; 78 int scanValue = 0, logValue = 0, rrdValue = 0; 79 int scanValue = 0, logValue = 0; 80 /* 81 * First RRD update at next RRD timeslot to prevent failures due 82 * one timeslot updated twice on restart for example. 83 */ 84 int rrdValue = rrdTime - time(NULL) % rrdTime; 79 85 80 86 sensorLog (LOG_INFO, "sensord started"); … … 94 100 if ((ret == 0) && rrdTime && rrdFile && (rrdValue <= 0)) { 95 101 ret = rrdUpdate (); 96 rrdValue += rrdTime; 102 /* 103 * The amount of time to wait is computed using the same method as 104 * in RRD instead of simply adding the interval. 105 */ 106 rrdValue = rrdTime - time(NULL) % rrdTime; 97 107 } 98 108 if (!done && (ret == 0)) {
