Changeset 11852
- Timestamp:
- Feb 16, 2007, 12:12:49 PM (19 years ago)
- Location:
- trunk/ippTools/src
- Files:
-
- 2 edited
-
warptool.c (modified) (3 diffs)
-
warptoolConfig.c (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/src/warptool.c
r11810 r11852 59 59 60 60 pxConfig *config = p4toolConfig(NULL, argc, argv); 61 if (!config) { 62 psError(PXTOOLS_ERR_CONFIG, false, "failed to configure"); 63 goto FAIL; 64 } 61 65 62 66 switch (config->mode) { … … 84 88 FAIL: 85 89 psErrorStackPrint(stderr, "\n"); 90 int exit_status = pxerrorGetExitStatus(); 86 91 87 92 psFree(config); … … 89 94 psLibFinalize(); 90 95 91 exit( EXIT_FAILURE);96 exit(exit_status); 92 97 } 93 98 -
trunk/ippTools/src/warptoolConfig.c
r11810 r11852 27 27 #include "p4tool.h" 28 28 29 // this function can not fail -- exits on error30 29 pxConfig *p4toolConfig(pxConfig *config, int argc, char **argv) { 31 30 if (!config) { … … 39 38 if (!config->modules) { 40 39 psError(PS_ERR_UNKNOWN, false, "Can't find site configuration"); 41 goto FAIL; 40 psFree(config); 41 return NULL; 42 42 } 43 43 … … 188 188 if (config->mode) { \ 189 189 psError(PS_ERR_UNKNOWN, true, "only one mode selection is allowed"); \ 190 goto FAIL; \ 190 psFree(config); \ 191 return NULL; \ 191 192 } \ 192 193 config->mode = modeval; \ … … 248 249 249 250 psFree(argSets); 250 goto FAIL; 251 psFree(config); 252 return NULL; 251 253 } 252 254 … … 261 263 if (!psMetadataAddStr(config->where, PS_LIST_TAIL, #name, 0, "==", str)) {\ 262 264 psError(PS_ERR_UNKNOWN, false, "failed to add item " #name); \ 263 goto FAIL; \ 265 psFree(config); \ 266 return NULL; \ 264 267 } \ 265 268 } \ … … 273 276 if (!psMetadataAddS32(config->where, PS_LIST_TAIL, #name, 0, "==", s32)) { \ 274 277 psError(PS_ERR_UNKNOWN, false, "failed to add item " #name); \ 275 goto FAIL; \ 278 psFree(config); \ 279 return NULL; \ 276 280 } \ 277 281 } \ … … 288 292 if (!psMetadataAddS32(config->where, PS_LIST_TAIL, "p4_id", 0, "==", (psS32)atoi(str))) { 289 293 psError(PS_ERR_UNKNOWN, false, "failed to add item p4_id"); 290 goto FAIL; 294 psFree(config); 295 return NULL; 291 296 } 292 297 } … … 307 312 if (!config->dbh) { 308 313 psError(PS_ERR_UNKNOWN, false, "Can't configure database"); 309 goto FAIL; 314 psFree(config); 315 return NULL; 310 316 } 311 317 … … 315 321 316 322 return config; 317 318 FAIL: 319 psFree(config); 320 pmConfigDone(); 321 psLibFinalize(); 322 exit(EXIT_FAILURE); 323 } 323 }
Note:
See TracChangeset
for help on using the changeset viewer.
