Skip to content
Snippets Groups Projects
Commit 0f7fd0d9 authored by rswindell's avatar rswindell
Browse files

Log errno and details upon file open failures in printfile() and printtail().

parent b2965f7e
Branches
Tags
No related merge requests found
......@@ -8,7 +8,7 @@
* @format.tab-size 4 (Plain Text/Source Code File Header) *
* @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) *
* *
* Copyright 2006 Rob Swindell - http://www.synchro.net/copyright.html *
* Copyright 2008 Rob Swindell - http://www.synchro.net/copyright.html *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License *
......@@ -79,7 +79,8 @@ void sbbs_t::printfile(char *str, long mode)
CRLF;
if((stream=fnopen(&file,str,O_RDONLY))==NULL) {
lprintf(LOG_NOTICE,"Node %d !File not found: %s",cfg.node_num,str);
lprintf(LOG_NOTICE,"Node %d !Error %d (%s) opening: %s"
,cfg.node_num,errno,strerror(errno),str);
bputs(text[FileNotFound]);
if(SYSOP) bputs(str);
CRLF;
......@@ -134,7 +135,8 @@ void sbbs_t::printtail(char *str, int lines, long mode)
CRLF;
}
if((file=nopen(str,O_RDONLY))==-1) {
lprintf(LOG_NOTICE,"Node %d !File not found: %s",cfg.node_num,str);
lprintf(LOG_NOTICE,"Node %d !Error %d (%s) opening: %s"
,cfg.node_num,errno,strerror(errno),str);
bputs(text[FileNotFound]);
if(SYSOP) bputs(str);
CRLF;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment