Changeset 11855
- Timestamp:
- Feb 16, 2007, 12:19:23 PM (19 years ago)
- Location:
- trunk/ippTools/src
- Files:
-
- 2 edited
-
dettool.c (modified) (3 diffs)
-
dettoolConfig.c (modified) (12 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/src/dettool.c
r11816 r11855 95 95 96 96 pxConfig *config = dettoolConfig(NULL, argc, argv); 97 if (!config) { 98 psError(PXTOOLS_ERR_CONFIG, false, "failed to configure"); 99 goto FAIL; 100 } 97 101 98 102 switch (config->mode) { … … 147 151 FAIL: 148 152 psErrorStackPrint(stderr, "\n"); 153 int exit_status = pxerrorGetExitStatus(); 149 154 150 155 psFree(config); … … 152 157 psLibFinalize(); 153 158 154 exit( EXIT_FAILURE);159 exit(exit_status); 155 160 } 156 161 -
trunk/ippTools/src/dettoolConfig.c
r11816 r11855 27 27 #include "dettool.h" 28 28 29 // this function can not fail -- exits on error30 29 pxConfig *dettoolConfig(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 … … 785 785 psFree(argset); \ 786 786 psFree(argSets); \ 787 goto FAIL; \ 787 psFree(config); \ 788 return NULL; \ 788 789 } \ 789 790 config->mode = modeval; \ … … 873 874 psFree(iter); 874 875 psFree(argSets); 875 goto FAIL; 876 psFree(config); 877 return NULL; 876 878 } 877 879 … … 886 888 if (!psMetadataAddStr(config->where, PS_LIST_TAIL, #name, 0, "==", str)) {\ 887 889 psError(PS_ERR_UNKNOWN, false, "failed to add item " #name); \ 888 goto FAIL; \ 890 psFree(config); \ 891 return NULL; \ 889 892 } \ 890 893 } \ … … 901 904 if (!psMetadataAddS32(config->where, PS_LIST_TAIL, "iteration", 0, "==", n)) { 902 905 psError(PS_ERR_UNKNOWN, false, "failed to add item iteration"); 903 goto FAIL; 906 psFree(config); 907 return NULL; 904 908 } 905 909 } … … 915 919 if (!psMetadataAddStr(config->where, PS_LIST_TAIL, "camera", 0, "==", str)) { 916 920 psError(PS_ERR_UNKNOWN, false, "failed to add item camera"); 917 goto FAIL; 921 psFree(config); 922 return NULL; 918 923 } 919 924 } … … 927 932 if (!psMetadataAddS32(config->where, PS_LIST_TAIL, "imfiles", 0, "==", n)) { 928 933 psError(PS_ERR_UNKNOWN, false, "failed to add item imfiles"); 929 goto FAIL; 934 psFree(config); 935 return NULL; 930 936 } 931 937 } … … 939 945 if (!psMetadataAddS32(config->where, PS_LIST_TAIL, "p1_version", 0, "==", n)) { 940 946 psError(PS_ERR_UNKNOWN, false, "failed to add item p1_version"); 941 goto FAIL; 947 psFree(config); 948 return NULL; 942 949 } 943 950 } … … 951 958 if (!psMetadataAddBool(config->where, PS_LIST_TAIL, "accept", 0, "==", !boolean)) { 952 959 psError(PS_ERR_UNKNOWN, false, "failed to add item reject"); 953 goto FAIL; 960 psFree(config); 961 return NULL; 954 962 } 955 963 } … … 967 975 if (!config->dbh) { 968 976 psError(PS_ERR_UNKNOWN, false, "Can't configure database"); 969 goto FAIL; 977 psFree(config); 978 return NULL; 970 979 } 971 980 … … 975 984 976 985 return config; 977 978 FAIL:979 psFree(config);980 pmConfigDone();981 psLibFinalize();982 exit(EXIT_FAILURE);983 986 }
Note:
See TracChangeset
for help on using the changeset viewer.
