Commit d1e421ac authored by rswindell's avatar rswindell

Don't attempt to close the nodefile descriptor if it is an invalid file

descriptor (-1), this is part of the node.dab error recovery scheme.
parent c9c05123
......@@ -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 2010 Rob Swindell - http://www.synchro.net/copyright.html *
* Copyright 2011 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 *
......@@ -91,7 +91,8 @@ int sbbs_t::getnodedat(uint number, node_t *node, bool lockit)
if(count==LOOP_NODEDAB) {
errormsg(WHERE,rd==sizeof(node_t) ? ERR_LOCK : ERR_READ,"node.dab",number+1);
close(nodefile);
if(nodefile!=-1)
close(nodefile);
nodefile=-1;
return(-2);
}
......
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