Changeset 16846 for trunk/psModules/src/detrend/pmDetrendDB.c
- Timestamp:
- Mar 6, 2008, 11:32:53 AM (18 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/detrend/pmDetrendDB.c (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/detrend/pmDetrendDB.c
r16611 r16846 118 118 int status, exit_status; 119 119 psString line = NULL; 120 char *time = psTimeToISO (&options->time);120 psString time = psTimeToISO (&options->time); 121 121 122 122 char *type = NULL; … … 149 149 psStringAppend(&line, " -airmass %f", options->twilight); 150 150 } 151 151 152 psIOBuffer *buffer = NULL; 153 psPipe *pipe = NULL; 154 psMetadata *answer = NULL; 155 152 156 if (!pmConfigDatabaseCommand(&line, config)) { 153 157 psError (PS_ERR_IO, false, "error building detrend command %s", line); … … 163 167 164 168 // use psPipe to exec the command, wait for response 165 psIOBuffer *buffer = psIOBufferAlloc (512);166 p sPipe *pipe = psPipeOpen (line);169 buffer = psIOBufferAlloc (512); 170 pipe = psPipeOpen (line); 167 171 if (!pipe) { 168 172 psError (PS_ERR_IO, false, "error calling command %s", line); … … 184 188 185 189 nFail = 0; 186 psMetadata *answer = psMetadataConfigParse (NULL, &nFail, buffer->data, false);190 answer = psMetadataConfigParse (NULL, &nFail, buffer->data, false); 187 191 if (!answer) { 188 192 psError(PS_ERR_IO, false, "failed to parse response from detselect\n"); … … 234 238 235 239 failure: 240 psFree (answer); 236 241 psFree (results); 237 242 psFree (pipe); … … 260 265 psStringAppend (&line, "detselect -select %s", detID); 261 266 if (classID && strlen(classID) > 0) { 262 psStringAppend(&line, " -class_id %s", classID);267 psStringAppend(&line, " -class_id %s", classID); 263 268 } 264 269 pmConfigDatabaseCommand(&line, config); … … 273 278 goto failure; 274 279 } 275 280 276 281 // timeout somewhat longer than 2sec. this could still be too short.... 277 282 status = psIOBufferReadEmpty (buffer, 2000, pipe->fd_stdout); … … 302 307 psMetadataItem *item = psMetadataLookup (answer, "detNormalizedImfile"); 303 308 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"); 305 310 goto failure; 306 311 }
Note:
See TracChangeset
for help on using the changeset viewer.
