From 9da7a5436f0463119c132a51d85c1f9afeb18f06 Mon Sep 17 00:00:00 2001 From: deuce <> Date: Sun, 27 Nov 2005 22:28:32 +0000 Subject: [PATCH] Log file.error and errno in file related error messages. --- exec/loadfont.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/exec/loadfont.js b/exec/loadfont.js index 25302ea3de..02d70e39b8 100644 --- a/exec/loadfont.js +++ b/exec/loadfont.js @@ -154,16 +154,16 @@ for (i in filenames) { } if(!font.open("rb",true,4096)) { - log(LOG_ERR,"!ERROR Unable to open "+filenames[i]+"!"); + log(LOG_ERR,"!ERROR "+font.error+" Unable to open "+filenames[i]+"! errno="+errno); continue; } // Doesn't work on Win32.. Win32 sucks. var fontdata=font.read(font.length); + font.close(); if(fontdata.length != font.length) { - log(LOG_ERR,"!ERROR Error reading font data (read "+fontdata.length+", expected "+font.length+")"); - font.close(); + log(LOG_ERR,"!ERROR Error "+font.error+" reading font data (read "+fontdata.length+", expected "+font.length+") errno="+errno); continue; } @@ -182,7 +182,6 @@ for (i in filenames) { // fontdata=fontdata.substr(1); } } - font.close(); if(showprogress) client.socket.send("."); } -- GitLab