- ret = fscanf(fh, "%lf", &uptime_seconds);
-
- fclose(fh);
-
- /* loop done, check if no value has been found/read */
- if (ret != 1) {
- ERROR("uptime plugin: No value read from " UPTIME_FILE "");
- return -1;
- }
-
- 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;