Skip to content

Commit

Permalink
sysinfo: fix - calculates the used nvram by getting only the vars sto…
Browse files Browse the repository at this point in the history
…red in the nvram itself and not in jffs partition
  • Loading branch information
zaloisio committed Dec 23, 2020
1 parent 1c8397c commit c3388d7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions release/src/router/httpd/sysinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ typedef struct {
} phyState;
#endif


extern int dev_nvram_getall(char *buf, int count);

unsigned int get_phy_temperature(int radio);
unsigned int get_wifi_clients(int unit, int querytype);
Expand Down Expand Up @@ -245,14 +245,14 @@ int ej_show_sysinfo(int eid, webs_t wp, int argc, char_t ** argv)
sysinfo(&sys);
sprintf(result,"%.2f",(sys.loads[2] / (float)(1<<SI_LOAD_SHIFT)));
} else if(strcmp(type,"nvram.total") == 0) {
sprintf(result,"%d",NVRAM_SPACE);
sprintf(result,"%d",MAX_NVRAM_SPACE);
} else if(strcmp(type,"nvram.used") == 0) {
char *buf;
int size = 0;

buf = malloc(NVRAM_SPACE);
buf = malloc(MAX_NVRAM_SPACE);
if (buf) {
nvram_getall(buf, NVRAM_SPACE);
dev_nvram_getall(buf, MAX_NVRAM_SPACE);
tmp = buf;
while (*tmp) tmp += strlen(tmp) +1;

Expand Down

0 comments on commit c3388d7

Please sign in to comment.