Commit af180afc authored by claes's avatar claes

Classvolumes inserted first in volume_cnf file

parent 0acfe6bf
/*
* Proview $Id: wb_lfu.cpp,v 1.3 2006-05-05 11:32:28 claes Exp $
* Proview $Id: wb_lfu.cpp,v 1.4 2006-05-24 06:00:59 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -695,14 +695,20 @@ pwr_tStatus lfu_SaveDirectoryVolume(
}
/* Check that the configured volumes exist */
sts = ldh_GetRootList( ldhses, &envobjid);
while ( ODD(sts))
{
for ( int k = 0; k < 2; k++) {
// Check class volumes in the first round, and other volumes after
for ( sts = ldh_GetRootList( ldhses, &envobjid);
ODD(sts);
sts = ldh_GetNextSibling( ldhses, envobjid, &envobjid)) {
sts = ldh_GetObjectClass( ldhses, envobjid, &cid);
if ( EVEN(sts)) return sts;
if ( cid == pwr_cClass_WbEnvironment)
{
if ( cid == pwr_cClass_WbEnvironment) {
if ( k != 1)
continue;
/* Create directory list file */
sts = ldh_ObjidToName( ldhses, envobjid, ldh_eName_Object,
name, sizeof(name), &size);
......@@ -734,16 +740,14 @@ pwr_tStatus lfu_SaveDirectoryVolume(
// Get xxxVolumeLoad objects
sts = ldh_GetChild( ldhses, envobjid, &volobjid);
while ( ODD(sts))
{
while ( ODD(sts)) {
sts = ldh_GetObjectClass( ldhses, volobjid, &cid);
if ( EVEN(sts)) return sts;
if ( cid == pwr_cClass_RootVolumeLoad ||
cid == pwr_cClass_SubVolumeLoad ||
cid == pwr_cClass_ClassVolumeLoad ||
cid == pwr_cClass_SharedVolumeLoad )
{
cid == pwr_cClass_SharedVolumeLoad ) {
sts = ldh_ObjidToName( ldhses, volobjid, ldh_eName_Object,
volume_name, sizeof(volume_name), &size);
if ( EVEN(sts)) return sts;
......@@ -752,15 +756,12 @@ pwr_tStatus lfu_SaveDirectoryVolume(
/* Check that the name is in the global volume list */
found = 0;
volumelist_ptr = volumelist;
for ( i = 0; i < volumecount; i++)
{
for ( i = 0; i < volumecount; i++) {
utl_toupper( volname, volumelist_ptr->volume_name);
if ( !strcmp( name, volname))
{
if ( !strcmp( name, volname)) {
found = 1;
switch (cid)
{
switch (cid) {
case pwr_cClass_RootVolumeLoad :
strcpy( classname, "RootVolume");
break;
......@@ -783,8 +784,7 @@ pwr_tStatus lfu_SaveDirectoryVolume(
}
volumelist_ptr++;
}
if ( !found)
{
if ( !found) {
char msg[200];
sprintf( msg, "Error in VolumeConfig object, '%s' is not configured in the global\
volume list", name);
......@@ -800,6 +800,11 @@ pwr_tStatus lfu_SaveDirectoryVolume(
cid == pwr_cClass_ClassVolumeConfig ||
cid == pwr_cClass_SharedVolumeConfig ||
cid == pwr_cClass_ExternVolumeConfig ) {
if ( cid != pwr_cClass_ClassVolumeConfig && k == 0)
continue;
if ( cid == pwr_cClass_ClassVolumeConfig && k == 1)
continue;
sts = ldh_ObjidToName( ldhses, envobjid, ldh_eName_Object,
volume_name, sizeof(volume_name), &size);
if ( EVEN(sts)) return sts;
......@@ -946,9 +951,8 @@ pwr_tStatus lfu_SaveDirectoryVolume(
}
}
}
sts = ldh_GetNextSibling( ldhses, envobjid, &envobjid);
}
}
fclose( file);
#if defined OS_VMS
system( "purge/nolog " load_cNameVolumeList);
......
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