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

getnodedat/putnodedat now keep file open and record locked.

parent 66b1ccc1
No related branches found
No related tags found
No related merge requests found
...@@ -2364,10 +2364,11 @@ void __fastcall TMainForm::ReloadConfigExecute(TObject *Sender) ...@@ -2364,10 +2364,11 @@ void __fastcall TMainForm::ReloadConfigExecute(TObject *Sender)
node_t node; node_t node;
for(int i=0;i<cfg.sys_nodes;i++) { for(int i=0;i<cfg.sys_nodes;i++) {
if(NodeForm->getnodedat(i+1,&node,true)) int file;
if(NodeForm->getnodedat(i+1,&node,&file))
break; break;
node.misc|=NODE_RRUN; node.misc|=NODE_RRUN;
if(NodeForm->putnodedat(i+1,&node)) if(NodeForm->putnodedat(i+1,&node,file))
break; break;
} }
} }
......
...@@ -83,12 +83,12 @@ void __fastcall TNodeForm::FormShow(TObject *Sender) ...@@ -83,12 +83,12 @@ void __fastcall TNodeForm::FormShow(TObject *Sender)
MainForm->ViewNodesButton->Down=true; MainForm->ViewNodesButton->Down=true;
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
int __fastcall TNodeForm::getnodedat(int node_num, node_t* node, bool lockit) int __fastcall TNodeForm::getnodedat(int node_num, node_t* node, int* file)
{ {
char errmsg[128]; char errmsg[128];
int err; int err;
if((err=::getnodedat(&MainForm->cfg,node_num,node,lockit))!=0) { if((err=::getnodedat(&MainForm->cfg,node_num,node,file))!=0) {
sprintf(errmsg,"getnodedat returned %d",err); sprintf(errmsg,"getnodedat returned %d",err);
Application->MessageBox(errmsg Application->MessageBox(errmsg
,"ERROR",MB_OK|MB_ICONEXCLAMATION); ,"ERROR",MB_OK|MB_ICONEXCLAMATION);
...@@ -97,13 +97,13 @@ int __fastcall TNodeForm::getnodedat(int node_num, node_t* node, bool lockit) ...@@ -97,13 +97,13 @@ int __fastcall TNodeForm::getnodedat(int node_num, node_t* node, bool lockit)
return(err); return(err);
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
int __fastcall TNodeForm::putnodedat(int node_num, node_t* node) int __fastcall TNodeForm::putnodedat(int node_num, node_t* node, int file)
{ {
char errmsg[128]; char errmsg[128];
int err; int err;
if((err=::putnodedat(&MainForm->cfg,node_num,node))!=0) { if((err=::putnodedat(&MainForm->cfg,node_num,node, file))!=0) {
sprintf(errmsg,"putnodedat returned %d",err); sprintf(errmsg,"putnodedat(%d) returned %d",file,err);
Application->MessageBox(errmsg Application->MessageBox(errmsg
,"ERROR",MB_OK|MB_ICONEXCLAMATION); ,"ERROR",MB_OK|MB_ICONEXCLAMATION);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment