Changeset 11842 for trunk/ippTools/src/regtoolConfig.c
- Timestamp:
- Feb 15, 2007, 3:52:15 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/ippTools/src/regtoolConfig.c (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/src/regtoolConfig.c
r11702 r11842 28 28 #include "p0tool.h" 29 29 30 // this function can not fail -- exits on error 31 pxConfig *p0toolConfig(pxConfig *config, int argc, char **argv) { 32 33 psExit exit_status = PS_EXIT_SUCCESS; 34 30 pxConfig *p0toolConfig(pxConfig *config, int argc, char **argv) 31 { 35 32 if (!config) { 36 33 config = pxConfigAlloc(); … … 43 40 if (!config->modules) { 44 41 psError(PXTOOLS_ERR_CONFIG, false, "Can't find site configuration"); 45 goto FAIL; 42 psFree(config); 43 return NULL; 46 44 } 47 45 … … 217 215 if (config->mode) { \ 218 216 psError(PXTOOLS_ERR_CONFIG, true, "only one mode selection is allowed"); \ 219 goto FAIL; \ 217 psFree(config); \ 218 return NULL; \ 220 219 } \ 221 220 config->mode = modeval; \ … … 267 266 268 267 psFree(argSets); 269 goto FAIL; 268 psFree(config); 269 return NULL; 270 270 } 271 271 … … 280 280 if (!psMetadataAddStr(config->where, PS_LIST_TAIL, #name, 0, "==", str)) {\ 281 281 psError(PXTOOLS_ERR_PROG, false, "failed to add item " #name); \ 282 goto FAIL; \ 282 psFree(config); \ 283 return NULL; \ 283 284 } \ 284 285 } \ … … 296 297 if (!psMetadataAddStr(config->where, PS_LIST_TAIL, "camera", 0, "==", str)) { 297 298 psError(PXTOOLS_ERR_PROG, false, "failed to add item camera"); 298 goto FAIL; 299 psFree(config); 300 return NULL; 299 301 } 300 302 } … … 308 310 if (!psMetadataAddS32(config->where, PS_LIST_TAIL, "imfiles", 0, "==", imfiles)) { 309 311 psError(PXTOOLS_ERR_PROG, false, "failed to add item imfiles"); 310 goto FAIL; 312 psFree(config); 313 return NULL; 311 314 } 312 315 } … … 326 329 if (!config->dbh) { 327 330 psError(PXTOOLS_ERR_SYS, false, "Can't configure database"); 328 goto FAIL; 331 psFree(config); 332 return NULL; 329 333 } 330 334 … … 333 337 config->argc = argc; 334 338 335 336 339 return config; 337 338 FAIL:339 // use the top-most error to determine the exit status340 exit_status = pxerrorGetExitStatus();341 342 psFree(config);343 pmConfigDone();344 psLibFinalize();345 exit(exit_status);346 340 }
Note:
See TracChangeset
for help on using the changeset viewer.
