- double uptime_seconds = 0.0;
- if (fscanf(fh, "%lf", &uptime_seconds) != 1) {
- ERROR("uptime plugin: No value read from " UPTIME_FILE "");
- fclose(fh);
- return -1;
- }
-
- fclose(fh);
-
- if (uptime_seconds == 0.0) {
- ERROR("uptime plugin: uptime read from " UPTIME_FILE ", "
- "but it is zero!");
- return -1;
- }
-
- boottime = time(NULL) - (long)uptime_seconds;