Commit f72cc1b8 authored by rswindell's avatar rswindell

getnodedat() - don't try to unlock the node.dab file unless the read() fails.

When using the MSVC2017 CRTL, an unlock() of a region that was not previously
locked is a blocking call causing major slowness in the MSVC2017 build.
parent 425d42b3
......@@ -81,7 +81,7 @@ int sbbs_t::getnodedat(uint number, node_t *node, bool lockit)
}
lseek(nodefile,(long)number*sizeof(node_t),SEEK_SET);
rd=read(nodefile,node,sizeof(node_t));
if(!lockit || rd!=sizeof(node_t))
if(rd!=sizeof(node_t))
unlock(nodefile,(long)number*sizeof(node_t),sizeof(node_t));
if(rd==sizeof(node_t))
break;
......
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