Changeset 11853
- Timestamp:
- Feb 16, 2007, 12:15:05 PM (19 years ago)
- Location:
- trunk/ippTools/src
- Files:
-
- 2 edited
-
difftool.c (modified) (3 diffs)
-
difftoolConfig.c (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/src/difftool.c
r11818 r11853 53 53 54 54 pxConfig *config = p5toolConfig(NULL, argc, argv); 55 if (!config) { 56 psError(PXTOOLS_ERR_CONFIG, false, "failed to configure"); 57 goto FAIL; 58 } 55 59 56 60 switch (config->mode) { … … 74 78 FAIL: 75 79 psErrorStackPrint(stderr, "\n"); 80 int exit_status = pxerrorGetExitStatus(); 76 81 77 82 psFree(config); … … 79 84 psLibFinalize(); 80 85 81 exit( EXIT_FAILURE);86 exit(exit_status); 82 87 } 83 88 -
trunk/ippTools/src/difftoolConfig.c
r11818 r11853 27 27 #include "p5tool.h" 28 28 29 // this function can not fail -- exits on error 30 pxConfig *p5toolConfig(pxConfig *config, int argc, char **argv){29 pxConfig *p5toolConfig(pxConfig *config, int argc, char **argv) 30 { 31 31 if (!config) { 32 32 config = pxConfigAlloc(); … … 39 39 if (!config->modules) { 40 40 psError(PS_ERR_UNKNOWN, false, "Can't find site configuration"); 41 goto FAIL; 41 psFree(config); 42 return NULL; 42 43 } 43 44 … … 148 149 if (config->mode) { \ 149 150 psError(PS_ERR_UNKNOWN, true, "only one mode selection is allowed"); \ 150 goto FAIL; \ 151 psFree(config); \ 152 return NULL; \ 151 153 } \ 152 154 config->mode = modeval; \ … … 196 198 197 199 psFree(argSets); 198 goto FAIL; 200 psFree(config); 201 return NULL; 199 202 } 200 203 … … 209 212 if (!psMetadataAddStr(config->where, PS_LIST_TAIL, #name, 0, "==", str)) {\ 210 213 psError(PS_ERR_UNKNOWN, false, "failed to add item " #name); \ 211 goto FAIL; \ 214 psFree(config); \ 215 return NULL; \ 212 216 } \ 213 217 } \ … … 221 225 if (!psMetadataAddS32(config->where, PS_LIST_TAIL, #name, 0, "==", s32)) { \ 222 226 psError(PS_ERR_UNKNOWN, false, "failed to add item " #name); \ 223 goto FAIL; \ 227 psFree(config); \ 228 return NULL; \ 224 229 } \ 225 230 } \ … … 236 241 if (!psMetadataAddS32(config->where, PS_LIST_TAIL, "p5_id", 0, "==", (psS32)atoi(str))) { 237 242 psError(PS_ERR_UNKNOWN, false, "failed to add item p5_id"); 238 goto FAIL; 243 psFree(config); 244 return NULL; 239 245 } 240 246 } … … 246 252 if (!psMetadataAddS32(config->where, PS_LIST_TAIL, "p4_id", 0, "==", (psS32)atoi(str))) { 247 253 psError(PS_ERR_UNKNOWN, false, "failed to add item p4_id"); 248 goto FAIL; 254 psFree(config); 255 return NULL; 249 256 } 250 257 } … … 264 271 if (!config->dbh) { 265 272 psError(PS_ERR_UNKNOWN, false, "Can't configure database"); 266 goto FAIL; 273 psFree(config); 274 return NULL; 267 275 } 268 276 … … 272 280 273 281 return config; 274 275 FAIL: 276 psFree(config); 277 pmConfigDone(); 278 psLibFinalize(); 279 exit(EXIT_FAILURE); 280 } 282 }
Note:
See TracChangeset
for help on using the changeset viewer.
