- FILE *fh = fopen(UPTIME_FILE, "r");
- if (fh == NULL) {
- char errbuf[1024];
- ERROR("uptime plugin: Cannot open " UPTIME_FILE ": %s",
- sstrerror(errno, errbuf, sizeof(errbuf)));
- return -1;
- }
-
- 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);