Commit 33b32a14 authored by Claes Sjofors's avatar Claes Sjofors

Cloned volume fix

parent 3560d30d
......@@ -62,6 +62,7 @@
#include "pwr.h"
#include "pwr_class.h"
#include "pwr_version.h"
#include "pwr_systemclasses.h"
#include "pwr_baseclasses.h"
#include "flow_ctx.h"
#include "co_cdh.h"
......@@ -340,6 +341,10 @@ static int utl_list_print_columnheader (
utl_t_listbody *listbody_ptr
);
static int utl_in_libhier(
ldh_tSesContext ldhses,
pwr_tOid oid
);
......@@ -1481,10 +1486,11 @@ int wb_utl::exec_plcpgms( ldh_tSesContext ldhses,
printf( "-- Executing Plcpgm %s\n", plcname);
sts = exec_plcpgm_windows( list_ptr->objid,
ldhses, ldhwb, no_focode, cb);
if ( EVEN (sts)) goto error_return;
if ( !utl_in_libhier( ldhses, list_ptr->objid)) {
sts = exec_plcpgm_windows( list_ptr->objid,
ldhses, ldhwb, no_focode, cb);
if ( EVEN (sts)) goto error_return;
}
list_ptr = list_ptr->next;
}
utl_objidlist_free( plcpgmlist);
......@@ -12527,3 +12533,20 @@ pwr_tStatus utl_read_line( char *line,
return 1;
}
static int utl_in_libhier( ldh_tSesContext ldhses, pwr_tOid oid)
{
pwr_tStatus sts;
pwr_tOid parent;
pwr_tCid cid;
for ( sts = ldh_GetParent( ldhses, oid, &parent);
ODD(sts);
sts = ldh_GetParent( ldhses, parent, &parent)) {
sts = ldh_GetObjectClass( ldhses, parent, &cid);
if ( EVEN(sts)) return 0;
if ( cid == pwr_cClass_LibHier)
return 1;
}
return 0;
}
......@@ -5418,12 +5418,17 @@ int WNav::clone_volume( char *vname, pwr_tVid vid)
if ( EVEN(sts)) return sts;
sts = ldh_VolumeIdToName( ldh_SessionToWB(ldhses),
info.Volume, pname, sizeof(pname), &size);
info.Volume, pname, sizeof(pname), &size);
if ( EVEN(sts)) return sts;
snprintf( comment, sizeof(comment), "-> %s", vname);
wb_log::log( wlog_eCategory_VolumeClone, pname, comment);
wb_log::log( (wb_session *)ldhses, wlog_eCategory_VolumeClone, vid, opt);
sts = ldh_VolumeIdToName( ldh_SessionToWB(ldhses),
vid, pname, sizeof(pname), &size);
if ( ODD(sts))
wb_log::log( (wb_session *)ldhses, wlog_eCategory_VolumeClone, vid, opt);
else
wb_log::log( wlog_eCategory_VolumeClone, vname, "");
wb_log::push();
wb_session *sp = (wb_session *)ldhses;
......
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