rounded uptime_sec

pull/102/head
alanbjohnston 5 years ago committed by GitHub
parent b6e853766f
commit 0479e2f833
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -639,7 +639,9 @@ int main(int argc, char * argv[]) {
FILE * uptime_file = fopen("/proc/uptime", "r"); FILE * uptime_file = fopen("/proc/uptime", "r");
fscanf(uptime_file, "%f", & uptime_sec); fscanf(uptime_file, "%f", & uptime_sec);
uptime = (int) uptime_sec;
uptime = (int) (uptime_sec + 0.5);
printf("Uptime sec: %f \n");
#ifdef DEBUG_LOGGING #ifdef DEBUG_LOGGING
printf("INFO: Reset Count: %d Uptime since Reset: %ld \n", reset_count, uptime); printf("INFO: Reset Count: %d Uptime since Reset: %ld \n", reset_count, uptime);
#endif #endif

Loading…
Cancel
Save

Powered by TurnKey Linux.