Commit 7a14dbca authored by Rob Swindell's avatar Rob Swindell 💬
Browse files

Fix free space detection in status window

Was using <data_dir>/temp to check for free space. data/temp is
not a normally created directory, so usually this check would fail
and just report 0 bytes free space. Instead, lets check the data
directory itself.
parent 0d8ea19e
Pipeline #1017 passed with stage
in 16 minutes and 12 seconds
......@@ -340,9 +340,9 @@ int drawstats(scfg_t *cfg, int nodenum, node_t *node, int *curp, int *barp) {
getstats(cfg, 0, &sstats);
t=time(NULL);
strftime(str[0][0],12,"%b %e",localtime(&t));
free=getfreediskspace(cfg->temp_dir,1024);
free=getfreediskspace(cfg->data_dir,1024);
if(free<1000) {
free=getfreediskspace(cfg->temp_dir,0);
free=getfreediskspace(cfg->data_dir,0);
getsizestr(str[0][1],free,TRUE);
}
else
......@@ -875,7 +875,7 @@ int main(int argc, char** argv) {
printf("ERROR! %s\n",str);
exit(1);
}
prep_dir(cfg.data_dir, cfg.temp_dir, sizeof(cfg.temp_dir));
prep_dir(cfg.ctrl_dir, cfg.temp_dir, sizeof(cfg.temp_dir));
memset(&uifc,0,sizeof(uifc));
uifc.mode|=UIFC_NOCTRL;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment