From 69cf0aa05fc2f417bf0bba08d485c5d96ba627b6 Mon Sep 17 00:00:00 2001
From: rswindell <>
Date: Fri, 10 Apr 2020 07:01:24 +0000
Subject: [PATCH] When a file fails to open, log the error value, e.g. this: 
 Error 24 opening '../fido/outbound/5e7a2520.pkt'.  Not sending. instead of
 this:  Unable to open '../fido/outbound/5e7ab832.pkt'.  Not sending.

Error 24 is "too many open files", btw. Another problem to solve.
---
 exec/load/binkp.js | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/exec/load/binkp.js b/exec/load/binkp.js
index 06844aa117..3370ad20b9 100644
--- a/exec/load/binkp.js
+++ b/exec/load/binkp.js
@@ -742,7 +742,7 @@ BinkP.prototype.session = function()
 										this.sendCmd(this.command.M_ERR, "Invalid offset of "+args[3]+" into file '"+tmp.name+"' size "+size);
 									}
 									if (!tmp.open(tmp.exists ? "r+b" : "wb")) {
-										log(LOG_ERROR, "Unable to open file "+tmp.name  + " from remote: " + this.remote_addrs );
+										log(LOG_ERROR, "Error " + tmp.error + " opening file "+tmp.name  + " from remote: " + this.remote_addrs );
 										this.sendCmd(this.command.M_SKIP, this.escapeFileName(args[0])+' '+args[1]+' '+args[2]);
 										break;
 									}
@@ -1259,7 +1259,7 @@ BinkP.prototype.addFile = function(path, sendas, waitget)
 	if (waitget === undefined)
 		waitget = true;
 	if (!file.open("rb", true)) {
-		log(LOG_WARNING, "Unable to open '"+file.name+"'.  Not sending.");
+		log(LOG_WARNING, "Error " + file.error + " opening '"+file.name+"'.  Not sending.");
 		return false;
 	}
 	if (this.debug)
-- 
GitLab