IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jul 14, 2006, 10:12:20 AM (20 years ago)
Author:
rhl
Message:

Replace another set of ifs with if else if etc.; check that save is TRUE or FALSE (why isn't this a bool?)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/config/pmConfig.c

    r7827 r7906  
    33 *  @author PAP, IfA
    44 *
    5  *  @version $Revision: 1.32 $ $Name: not supported by cvs2svn $
    6  *  @date $Date: 2006-07-06 03:25:50 $
     5 *  @version $Revision: 1.33 $ $Name: not supported by cvs2svn $
     6 *  @date $Date: 2006-07-14 20:12:20 $
    77 *
    88 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    288288
    289289    // Load the recipes from the camera file, if appropriate
    290     pmConfigReadRecipes(config);
     290    if(!pmConfigReadRecipes(config)) {
     291        psError(PS_ERR_IO, false, "Failed to read recipes from camera file");
     292        psFree(config);
     293        return NULL;
     294    }
    291295
    292296    //
     
    660664            psMetadataAdd(config->recipes, PS_LIST_TAIL, fileItem->name,
    661665                          PS_DATA_METADATA | PS_META_REPLACE, fileItem->comment, recipe);
     666        } else {
     667            psError(PS_ERR_IO, false, "Failed to read recipe");
     668
     669            psFree(recipe);  // Drop reference
     670            psFree(recipesIter);
     671
     672            return false;
    662673        }
    663674        psFree(recipe);                 // Drop reference
     
    704715    // Read the recipe file names from the site configuration and camera configuration
    705716    if (!(config->recipesRead & P_PM_RECIPE_SOURCE_SITE)) {
    706         loadRecipes(config, config->site, P_PM_RECIPE_SOURCE_SITE, "site configuration");
     717        if(!loadRecipes(config, config->site, P_PM_RECIPE_SOURCE_SITE, "site configuration")) {
     718            psError(PS_ERR_IO, false, "Failed to read recipes from site config");
     719            #if 0     // see comment at end of routine
     720
     721            return false;
     722            #endif
     723
     724        }
    707725    }
    708726    if (!(config->recipesRead & P_PM_RECIPE_SOURCE_CAMERA)) {
    709         loadRecipes(config, config->camera, P_PM_RECIPE_SOURCE_CAMERA, "camera configuration");
    710     }
     727        if (!loadRecipes(config, config->camera, P_PM_RECIPE_SOURCE_CAMERA, "camera configuration")) {
     728            psError(PS_ERR_IO, false, "Failed to read recipes from camera config");
     729            #if 0     // see comment at end of routine
     730
     731            return false;
     732            #endif
     733
     734        }
     735    }
     736
    711737    if (!(config->recipesRead & P_PM_RECIPE_SOURCE_CL)) {
    712738        // Go through the command-line arguments
     
    762788        config->recipesRead |= P_PM_RECIPE_SOURCE_CL;
    763789    }
    764 
     790    /*
     791     * We may have seen real errors, but we also get false status returned by valid conditions (e.g. asking a
     792     * file for a recipe when none was provided).  For now we'll never signal an error, but this should
     793     * be reconsidered ASAP.
     794     */
     795    psErrorClear();
    765796    return true;
    766797}
Note: See TracChangeset for help on using the changeset viewer.