Synchronet now requires the libarchive development package (e.g. libarchive-dev on Debian-based Linux distros, libarchive.org for more info) to build successfully.

Commit 89497862 authored by mcmlxxix's avatar mcmlxxix

return false if cnf file fails to open

return true if all the other crap happens as it should
parent 1ca71bfe
......@@ -65,7 +65,7 @@ var CNF = new (function() {
case "obj":
data[p] = readRecord(file,struct[p].bytes);
break;
case "lst":
case "arr":
data[p] = readArray(file,struct[p].bytes);
break;
case "ntv":
......@@ -122,7 +122,7 @@ var CNF = new (function() {
case "obj":
writeRecord(file,struct[p].bytes,record[p]);
break;
case "lst":
case "arr":
writeArray(file,struct[p].bytes,record[p]);
break;
case "ntv":
......@@ -159,11 +159,12 @@ var CNF = new (function() {
/* write records to .cnf file */
this.write = function(fileName,struct,data) {
var f = new File(fileName);
f.open('wb',true);
if(!f.open('wb',true))
return false;
writeRecord(f,struct,data);
f.close();
return true;
}
})();
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