Changeset 34052 for branches/eam_branches/ipp-20120601/ippTools/src
- Timestamp:
- Jun 22, 2012, 6:52:56 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20120601/ippTools/src/pstamptool.c
r34051 r34052 1046 1046 // it's an allowed arg because add_poll_args adds it 1047 1047 PXOPT_LOOKUP_U64(limit, config->args, "-limit", false, false); 1048 if (limit) { /* do something?? */ 1048 if (limit) { /* do something?? */ } 1049 1049 1050 1050 PXOPT_LOOKUP_S16(fault, config->args, "-fault", false, false); … … 1055 1055 psString faultClause = psStringCopy(""); 1056 1056 if (!fault) { 1057 psStringAppend(&faultClause, " \nAND (pstampJob.fault < %d)", PSTAMP_FIRST_ERROR_CODE);1057 psStringAppend(&faultClause, " \nAND (pstampJob.fault < %d)", PSTAMP_FIRST_ERROR_CODE); 1058 1058 } 1059 1059 1060 1060 psString query = pxDataGet("pstamptool_revertjob.sql"); 1061 1061 if (!psListLength(where->list) && !all) { 1062 psFree(where);1063 psError(PXTOOLS_ERR_CONFIG, false, "search parameters or -all are required");1064 return false;1062 psFree(where); 1063 psError(PXTOOLS_ERR_CONFIG, false, "search parameters or -all are required"); 1064 return false; 1065 1065 } 1066 1066 if (psListLength(where->list)) { 1067 psString whereClause = psDBGenerateWhereConditionSQL(where, NULL);1068 psStringAppend(&query, " AND %s", whereClause);1069 psFree(whereClause);1067 psString whereClause = psDBGenerateWhereConditionSQL(where, NULL); 1068 psStringAppend(&query, " AND %s", whereClause); 1069 psFree(whereClause); 1070 1070 } 1071 1071 psFree(where); … … 1075 1075 psString faultCountClause = NULL; 1076 1076 if (clear_fault_count) { 1077 psStringAppend(&faultCountClause, "\n, pstampJob.fault_count = 0");1077 psStringAppend(&faultCountClause, "\n, pstampJob.fault_count = 0"); 1078 1078 } else { 1079 psStringAppend(&query, " AND pstampJob.fault_count < %d", PSTAMP_MAX_JOB_FAULTS);1079 psStringAppend(&query, " AND pstampJob.fault_count < %d", PSTAMP_MAX_JOB_FAULTS); 1080 1080 } 1081 1081 1082 1082 if (!p_psDBRunQueryF(config->dbh, query, faultCountClause, faultClause)) { 1083 psFree(faultCountClause);1084 psFree(faultClause);1085 psFree(query);1086 psError(PS_ERR_UNKNOWN, false, "database error");1087 return false;1083 psFree(faultCountClause); 1084 psFree(faultClause); 1085 psFree(query); 1086 psError(PS_ERR_UNKNOWN, false, "database error"); 1087 return false; 1088 1088 } 1089 1089 … … 1094 1094 return true; 1095 1095 } 1096 1096 1097 static bool addprojectMode(pxConfig *config) 1097 1098 { … … 1107 1108 1108 1109 if (!pstampProjectInsert(config->dbh, 1109 0,1110 name,1111 state,1112 imagedb,1113 dvodb,1114 camera,1115 telescope,1116 need_magic1117 )) {1110 0, 1111 name, 1112 state, 1113 imagedb, 1114 dvodb, 1115 camera, 1116 telescope, 1117 need_magic 1118 )) { 1118 1119 psError(PS_ERR_UNKNOWN, false, "database error"); 1119 1120 return false;
Note:
See TracChangeset
for help on using the changeset viewer.
