Changeset 11843
- Timestamp:
- Feb 15, 2007, 3:55:36 PM (19 years ago)
- Location:
- trunk/ippTools/src
- Files:
-
- 2 edited
-
chiptool.c (modified) (3 diffs)
-
chiptoolConfig.c (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/src/chiptool.c
r11735 r11843 54 54 55 55 pxConfig *config = p2toolConfig(NULL, argc, argv); 56 if (!config) { 57 psError(PXTOOLS_ERR_CONFIG, false, "failed to configure"); 58 goto FAIL; 59 } 56 60 57 61 switch (config->mode) { … … 76 80 FAIL: 77 81 psErrorStackPrint(stderr, "\n"); 82 int exit_status = pxerrorGetExitStatus(); 78 83 79 84 psFree(config); … … 81 86 psLibFinalize(); 82 87 83 exit( EXIT_FAILURE);88 exit(exit_status); 84 89 } 85 90 -
trunk/ippTools/src/chiptoolConfig.c
r11702 r11843 27 27 #include "p2tool.h" 28 28 29 // this function can not fail -- exits on error30 29 pxConfig *p2toolConfig(pxConfig *config, int argc, char **argv) { 31 30 if (!config) { … … 38 37 if (! config->modules) { 39 38 psError(PS_ERR_UNKNOWN, false, "Can't find site configuration"); 40 goto FAIL; 39 psFree(config); 40 return NULL; 41 41 } 42 42 … … 186 186 if (config->mode) { \ 187 187 psError(PS_ERR_UNKNOWN, true, "only one mode selection is allowed"); \ 188 goto FAIL; \ 188 psFree(config); \ 189 return NULL; \ 189 190 } \ 190 191 config->mode = modeval; \ … … 233 234 234 235 psFree(argSets); 235 goto FAIL; 236 psFree(config); 237 return NULL; 236 238 } 237 239 … … 246 248 if (!psMetadataAddStr(config->where, PS_LIST_TAIL, #name, 0, "==", str)) {\ 247 249 psError(PS_ERR_UNKNOWN, false, "failed to add item " #name); \ 248 goto FAIL; \ 250 psFree(config); \ 251 return NULL; \ 249 252 } \ 250 253 } \ … … 264 267 if (!psMetadataAddStr(config->where, PS_LIST_TAIL, "camera", 0, "==", str)) { 265 268 psError(PS_ERR_UNKNOWN, false, "failed to add item camera"); 266 goto FAIL; 269 psFree(config); 270 return NULL; 267 271 } 268 272 } … … 291 295 if (!config->dbh) { 292 296 psError(PS_ERR_UNKNOWN, false, "Can't configure database"); 293 goto FAIL; 297 psFree(config); 298 return NULL; 294 299 } 295 300 … … 299 304 300 305 return config; 301 302 FAIL:303 psFree(config);304 pmConfigDone();305 psLibFinalize();306 exit(EXIT_FAILURE);307 306 }
Note:
See TracChangeset
for help on using the changeset viewer.
