Commit 82ad08c0 authored by rswindell's avatar rswindell

getnodedat() still attempts read if record lock fails (already locked?).

parent aa6082f3
......@@ -70,7 +70,8 @@ int sbbs_t::getnodedat(uint number, node_t *node, bool lockit)
for(count=0;count<LOOP_NODEDAB;count++) {
if(count)
mswait(100);
if(lock(nodefile,(long)number*sizeof(node_t),sizeof(node_t))!=0)
if(lock(nodefile,(long)number*sizeof(node_t),sizeof(node_t))!=0
&& lockit)
continue;
lseek(nodefile,(long)number*sizeof(node_t),SEEK_SET);
rd=read(nodefile,node,sizeof(node_t));
......
......@@ -689,7 +689,8 @@ int DLLCALL getnodedat(scfg_t* cfg, uint number, node_t *node, int* fdp)
if(count)
mswait(100);
lseek(file,(long)number*sizeof(node_t),SEEK_SET);
if(lock(file,(long)number*sizeof(node_t),sizeof(node_t))!=0)
if(lock(file,(long)number*sizeof(node_t),sizeof(node_t))!=0
&& fdp!=NULL)
continue;
rd=read(file,node,sizeof(node_t));
if(fdp==NULL || rd!=sizeof(node_t))
......
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