Commit 89550cb6 authored by Claes Sjofors's avatar Claes Sjofors

Plc, embedded plc build added to rootvolume build method

parent c2d370df
......@@ -55,6 +55,7 @@
#include "wb_build.h"
#include "wb_env.h"
#include "wb_lfu.h"
#include "wb_gcg.h"
#include "wb_foe.h"
#include "wb_merep.h"
#include "wb_dblock.h"
......@@ -704,6 +705,10 @@ void wb_build::rootvolume(pwr_tVid vid)
if (!opt.manual) {
// Build all plcpgm
m_sts = gcg_comp_plcembed_all((ldh_tSession*)&m_session, opt.force);
if (evenSts())
return;
classlist(pwr_cClass_plc);
if (evenSts())
return;
......
......@@ -15846,11 +15846,24 @@ static int gcg_in_libhier(gcg_ctx gcgctx, pwr_tOid oid)
return 0;
}
int gcg_comp_plcembed_all(ldh_tSession ldhses)
int gcg_comp_plcembed_all(ldh_tSession ldhses, int force)
{
pwr_tAttrRef plcint_aref;
pwr_tOid last_oid = pwr_cNOid;
pwr_tStatus sts;
pwr_tStatus sts, rsts;
bool write_set = false;
ldh_sSessInfo info;
sts = ldh_GetSessionInfo(ldhses, &info);
if (EVEN(sts))
return sts;
if (info.Access == ldh_eAccess_ReadOnly) {
sts = ldh_SetSession(ldhses, ldh_eAccess_SharedReadWrite);
if (EVEN(sts))
return sts;
write_set = true;
}
for (sts = ldh_GetClassListAttrRef(ldhses, pwr_cClass_PlcEmbed, &plcint_aref);
ODD(sts); sts = ldh_GetNextAttrRef(
......@@ -15858,16 +15871,28 @@ int gcg_comp_plcembed_all(ldh_tSession ldhses)
if (cdh_ObjidIsEqual(last_oid, plcint_aref.Objid))
continue;
sts = gcg_comp_plcembed(ldhses, plcint_aref.Objid);
if (EVEN(sts))
return sts;
rsts = gcg_comp_plcembed(ldhses, plcint_aref.Objid, force);
if (EVEN(rsts))
break;
last_oid = plcint_aref.Objid;
}
if (write_set) {
sts = ldh_SaveSession(ldhses);
if (EVEN(sts))
return sts;
sts = ldh_SetSession(ldhses, ldh_eAccess_ReadOnly);
if (EVEN(sts))
return sts;
}
if (EVEN(rsts))
return rsts;
return GSX__SUCCESS;
}
int gcg_comp_plcembed(ldh_tSession ldhses, pwr_tOid oid)
int gcg_comp_plcembed(ldh_tSession ldhses, pwr_tOid oid, int force)
{
pwr_tStatus sts;
pwr_tAttrRef aref;
......@@ -16007,10 +16032,14 @@ int gcg_comp_plcembed(ldh_tSession ldhses, pwr_tOid oid)
memcpy(&mod_time, mod_time_ptr, sizeof(mod_time));
free((char*)mod_time_ptr);
if (template_time->tv_sec != mod_time.tv_sec)
modified = 1;
else
modified = 0;
if (force)
modified = 1;
else {
if (template_time->tv_sec != mod_time.tv_sec)
modified = 1;
else
modified = 0;
}
if (modified) {
// Delete old window
......
......@@ -240,8 +240,8 @@ pwr_tStatus gcg_read_volume_plclist(pwr_tVolumeId volid,
unsigned long* thread_count, gcg_t_threadlist** threadlist,
unsigned long* plcproc_count, gcg_t_plcproclist** plcproclist);
int gcg_comp_plcembed_all(ldh_tSession ldhses);
int gcg_comp_plcembed(ldh_tSession ldhses, pwr_tOid oid);
int gcg_comp_plcembed_all(ldh_tSession ldhses, int force);
int gcg_comp_plcembed(ldh_tSession ldhses, pwr_tOid oid, int force);
#ifdef __cplusplus
}
......
......@@ -1840,7 +1840,7 @@ static int wnav_compile_func(void* client_data, void* client_flag)
return sts;
if (allplcpgm) {
sts = gcg_comp_plcembed_all(wnav->ldhses);
sts = gcg_comp_plcembed_all(wnav->ldhses, 0);
if (EVEN(sts)) {
wnav->message('E', wnav_get_message(sts));
return sts;
......@@ -1852,7 +1852,7 @@ static int wnav_compile_func(void* client_data, void* client_flag)
return sts;
}
sts = gcg_comp_plcembed(wnav->ldhses, oid);
sts = gcg_comp_plcembed(wnav->ldhses, oid, 0);
if (EVEN(sts)) {
wnav->message('E', wnav_get_message(sts));
return sts;
......
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