IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 6, 2008, 11:32:53 AM (18 years ago)
Author:
Paul Price
Message:

Pre-declare values before the "goto" so that if it arrives at the label it knows what it is.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/detrend/pmDetrendDB.c

    r16611 r16846  
    118118    int status, exit_status;
    119119    psString line = NULL;
    120     char *time = psTimeToISO (&options->time);
     120    psString time = psTimeToISO (&options->time);
    121121
    122122    char *type = NULL;
     
    149149        psStringAppend(&line, " -airmass %f", options->twilight);
    150150    }
    151    
     151
     152    psIOBuffer *buffer = NULL;
     153    psPipe *pipe = NULL;
     154    psMetadata *answer = NULL;
     155
    152156    if (!pmConfigDatabaseCommand(&line, config)) {
    153157        psError (PS_ERR_IO, false, "error building detrend command %s", line);
     
    163167
    164168    // use psPipe to exec the command, wait for response
    165     psIOBuffer *buffer = psIOBufferAlloc (512);
    166     psPipe *pipe = psPipeOpen (line);
     169    buffer = psIOBufferAlloc (512);
     170    pipe = psPipeOpen (line);
    167171    if (!pipe) {
    168172        psError (PS_ERR_IO, false, "error calling command %s", line);
     
    184188
    185189    nFail = 0;
    186     psMetadata *answer = psMetadataConfigParse (NULL, &nFail, buffer->data, false);
     190    answer = psMetadataConfigParse (NULL, &nFail, buffer->data, false);
    187191    if (!answer) {
    188192        psError(PS_ERR_IO, false, "failed to parse response from detselect\n");
     
    234238
    235239failure:
     240    psFree (answer);
    236241    psFree (results);
    237242    psFree (pipe);
     
    260265    psStringAppend (&line, "detselect -select %s", detID);
    261266    if (classID && strlen(classID) > 0) {
    262         psStringAppend(&line, " -class_id %s", classID);
     267        psStringAppend(&line, " -class_id %s", classID);
    263268    }
    264269    pmConfigDatabaseCommand(&line, config);
     
    273278        goto failure;
    274279    }
    275    
     280
    276281    // timeout somewhat longer than 2sec.  this could still be too short....
    277282    status = psIOBufferReadEmpty (buffer, 2000, pipe->fd_stdout);
     
    302307    psMetadataItem *item = psMetadataLookup (answer, "detNormalizedImfile");
    303308    if ((item->type == PS_DATA_METADATA_MULTI) && (item->data.list->n > 1)) {
    304         psError(PS_ERR_IO, false, "detselect returned too many files\n");
     309        psError(PS_ERR_IO, false, "detselect returned too many files\n");
    305310        goto failure;
    306311    }
Note: See TracChangeset for help on using the changeset viewer.