Skip to content

Commit

Permalink
Memory reading made no sense in /api/status
Browse files Browse the repository at this point in the history
  • Loading branch information
wberube committed Aug 20, 2024
1 parent a84bfcc commit 0e83dff
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/server.c
Original file line number Diff line number Diff line change
Expand Up @@ -1112,9 +1112,9 @@ void *server_thread(void *vargp) {
struct sysinfo si;
sysinfo(&si);
char memory[16], uptime[48];
short used = (si.freeram + si.bufferram) / 1024 / 1024;
short free = (si.freeram + si.bufferram) / 1024 / 1024;
short total = si.totalram / 1024 / 1024;
sprintf(memory, "%d/%dMB", used, total);
sprintf(memory, "%d/%dMB", total - free, total);
if (si.uptime > 86400)
sprintf(uptime, "%ld days, %ld:%02ld:%02ld", si.uptime / 86400, (si.uptime % 86400) / 3600, (si.uptime % 3600) / 60, si.uptime % 60);
else if (si.uptime > 3600)
Expand Down

0 comments on commit 0e83dff

Please sign in to comment.