Skip to content
Snippets Groups Projects
Commit 521a84b3 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

min_dspace is now in bytes, not kilobytes, so deal with that

parent cf15ad52
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
Pipeline #3773 passed
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
#ifdef BUILD_JSDOCS #ifdef BUILD_JSDOCS
static char* file_area_prop_desc[] = { static char* file_area_prop_desc[] = {
"minimum amount of available disk space (in kilobytes) required for user uploads to be allowed" "minimum amount of available disk space (in bytes) required for user uploads to be allowed"
,"file area settings (bitfield) - see <tt>FM_*</tt> in <tt>sbbsdefs.js</tt> for details" ,"file area settings (bitfield) - see <tt>FM_*</tt> in <tt>sbbsdefs.js</tt> for details"
,"web file virtual path prefix <i>(introduced in v3.19c)</i>" ,"web file virtual path prefix <i>(introduced in v3.19c)</i>"
,NULL ,NULL
...@@ -216,7 +216,7 @@ JSBool js_file_area_resolve(JSContext* cx, JSObject* areaobj, jsid id) ...@@ -216,7 +216,7 @@ JSBool js_file_area_resolve(JSContext* cx, JSObject* areaobj, jsid id)
if(name==NULL || strcmp(name, "min_diskspace")==0) { if(name==NULL || strcmp(name, "min_diskspace")==0) {
if(name) if(name)
free(name); free(name);
val=UINT_TO_JSVAL(p->cfg->min_dspace); val=DOUBLE_TO_JSVAL((jsdouble)p->cfg->min_dspace);
JS_DefineProperty(cx, areaobj, "min_diskspace", val, NULL, NULL, JSPROP_ENUMERATE); JS_DefineProperty(cx, areaobj, "min_diskspace", val, NULL, NULL, JSPROP_ENUMERATE);
if(name) if(name)
return(JS_TRUE); return(JS_TRUE);
......
...@@ -249,9 +249,9 @@ bool sbbs_t::upload(uint dirnum) ...@@ -249,9 +249,9 @@ bool sbbs_t::upload(uint dirnum)
/* get free disk space */ /* get free disk space */
space=getfreediskspace(path,1024); space=getfreediskspace(path,1024);
if(space<(ulong)cfg.min_dspace) { if(space<(ulong)(cfg.min_dspace / 1024)) {
bputs(text[LowDiskSpace]); bputs(text[LowDiskSpace]);
lprintf(LOG_ERR,"Diskspace is low: %s (%lu kilobytes)",path,space); lprintf(LOG_ERR,"Diskspace is low: %s (%lu KB)",path,space);
if(!dir_op(dirnum)) if(!dir_op(dirnum))
return(false); return(false);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment