Commit 9ccdbce6 authored by rswindell's avatar rswindell
Browse files

Check return value of getnodedat().

parent 144638a0
......@@ -157,9 +157,10 @@ void sbbs_t::batchmenu()
: cfg.dir[batdn_dir[i]]->path
,tmp);
mv(str,tmp2,1); /* copy the file to temp dir */
getnodedat(cfg.node_num,&thisnode,1);
thisnode.aux=0xff;
putnodedat(cfg.node_num,&thisnode);
if(getnodedat(cfg.node_num,&thisnode,true)==0) {
thisnode.aux=0xff;
putnodedat(cfg.node_num,&thisnode);
}
CRLF;
}
}
......@@ -410,9 +411,10 @@ BOOL sbbs_t::start_batch_download()
: cfg.dir[batdn_dir[i]]->path
,fname);
mv(str,path,1); /* copy the file to temp dir */
getnodedat(cfg.node_num,&thisnode,1);
thisnode.aux=40; /* clear the seq dev # */
putnodedat(cfg.node_num,&thisnode);
if(getnodedat(cfg.node_num,&thisnode,true)==0) {
thisnode.aux=40; /* clear the seq dev # */
putnodedat(cfg.node_num,&thisnode);
}
CRLF;
}
}
......@@ -448,15 +450,16 @@ BOOL sbbs_t::start_batch_download()
}
sprintf(str,"%sBATCHDN.LST",cfg.node_dir);
getnodedat(cfg.node_num,&thisnode,1);
action=NODE_DLNG;
t=now;
if(cur_cps)
t+=(totalsize/(ulong)cur_cps);
localtime_r(&t,&tm);
thisnode.aux=(tm.tm_hour*60)+tm.tm_min;
thisnode.action=action;
putnodedat(cfg.node_num,&thisnode); /* calculate ETA */
if(getnodedat(cfg.node_num,&thisnode,true)==0) {
thisnode.aux=(tm.tm_hour*60)+tm.tm_min;
thisnode.action=action;
putnodedat(cfg.node_num,&thisnode); /* calculate ETA */
}
start=time(NULL);
error=protocol(cmdstr(cfg.prot[xfrprot]->batdlcmd,str,list,NULL),false);
end=time(NULL);
......
......@@ -351,15 +351,18 @@ void sbbs_t::seqwait(uint devnum)
for(start=now=time(NULL);online && now-start<90;now=time(NULL)) {
if(msgabort()) /* max wait ^^^^ sec */
break;
getnodedat(cfg.node_num,&thisnode,1); /* open and lock this record */
getnodedat(cfg.node_num,&thisnode,true); /* open and lock this record */
for(i=1;i<=cfg.sys_nodes;i++) {
if(i==cfg.node_num) continue;
getnodedat(i,&node,1);
if((node.status==NODE_INUSE || node.status==NODE_QUIET)
&& node.action==NODE_RFSD && node.aux==devnum) {
putnodedat(i,&node);
break; }
putnodedat(i,&node); }
if(getnodedat(i,&node,true)==0) {
if((node.status==NODE_INUSE || node.status==NODE_QUIET)
&& node.action==NODE_RFSD && node.aux==devnum) {
putnodedat(i,&node);
break;
}
putnodedat(i,&node);
}
}
if(i>cfg.sys_nodes) {
thisnode.action=NODE_RFSD;
thisnode.aux=devnum;
......
......@@ -285,10 +285,14 @@ int sbbs_t::exec_function(csi_t *csi)
if(i<=cfg.sys_nodes || criterrs) {
if(!noyes(text[ClearErrCounter])) {
for(i=1;i<=cfg.sys_nodes;i++) {
getnodedat(i,&node,1);
node.errors=0;
putnodedat(i,&node); }
criterrs=0; } }
if(getnodedat(i,&node,true)==0) {
node.errors=0;
putnodedat(i,&node);
}
criterrs=0;
}
}
}
return(0);
case CS_ANSI_CAPTURE: /* Capture ANSI codes */
sys_status^=SS_ANSCAP;
......
......@@ -106,9 +106,12 @@ int sbbs_t::listfiles(uint dirnum, char *filespec, int tofile, long mode)
action=NODE_LFIL;
getnodedat(cfg.node_num,&thisnode,0);
if(thisnode.action!=NODE_LFIL) { /* was a sync */
getnodedat(cfg.node_num,&thisnode,1);
thisnode.action=NODE_LFIL;
putnodedat(cfg.node_num,&thisnode); } }
if(getnodedat(cfg.node_num,&thisnode,true)==0) {
thisnode.action=NODE_LFIL;
putnodedat(cfg.node_num,&thisnode);
}
}
}
while(online && found<MAX_FILES) {
if(found<0)
......@@ -1282,10 +1285,12 @@ int sbbs_t::listfileinfo(uint dirnum, char *filespec, long mode)
sprintf(str,"%s%s",dirpath,fname);
sprintf(path,"%s%s",cfg.temp_dir,fname);
mv(str,path,1); /* copy the file to temp dir */
getnodedat(cfg.node_num,&thisnode,1);
thisnode.aux=0xf0;
putnodedat(cfg.node_num,&thisnode);
CRLF; }
if(getnodedat(cfg.node_num,&thisnode,true)==0) {
thisnode.aux=0xf0;
putnodedat(cfg.node_num,&thisnode);
}
CRLF;
}
for(j=0;j<cfg.total_dlevents;j++)
if(!stricmp(cfg.dlevent[j]->ext,f.name+9)
&& chk_ar(cfg.dlevent[j]->ar,&useron)) {
......
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