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 addc4b4b authored by rswindell's avatar rswindell

Log an error in rename_or_move() when there's a failure, for more debugging

details.
parent 4100deed
......@@ -324,10 +324,13 @@ function rename_or_move(src, dst)
if (file_rename(src, dst))
return true;
sf = new File(src);
if (!sf.open("rb"))
if (!sf.open("rb")) {
log(LOG_ERR, "Error " + sf.error + " opening " + sf.name);
return false;
}
df = new File(dst);
if (!df.open("wb")) { // Used to include 'e' mode flag (which never worked)
log(LOG_ERR, "Error " + df.error + " opening " + df.name);
sf.close();
return false;
}
......@@ -340,6 +343,7 @@ function rename_or_move(src, dst)
remain = 0x200000;
buf = sf.read(remain);
if (!df.write(buf)) {
log(LOG_ERR, "Error " + df.error + " writing to " + df.name);
df.close();
df.remove();
sf.close();
......
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