Changeset 16242 for trunk/ippTools/src/warptool.c
- Timestamp:
- Jan 25, 2008, 2:41:18 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/ippTools/src/warptool.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/src/warptool.c
r16170 r16242 30 30 #include "pxtools.h" 31 31 #include "warptool.h" 32 #include "pxwarp.h" 32 33 33 34 static psS64 definerunMode(pxConfig *config); … … 46 47 47 48 static bool parseAndInsertSkyCellMap(pxConfig *config, const char *mapfile); 48 static bool setwarpRunState(pxConfig *config, psS64 warp_id, const char *state);49 49 static bool isValidMode(pxConfig *config, const char *mode); 50 50 bool warpCompletedRuns(pxConfig *config); … … 200 200 return false; 201 201 } 202 if (! setwarpRunState(config, warp_id, "run")) {202 if (!pxwarpRunSetState(config, warp_id, "run")) { 203 203 // rollback 204 204 if (!psDBRollback(config->dbh)) { … … 227 227 if (state) { 228 228 // set detRun.state to state 229 return setwarpRunState(config, (psS64)atoll(warp_id), state);229 return pxwarpRunSetState(config, (psS64)atoll(warp_id), state); 230 230 } 231 231 … … 999 999 1000 1000 1001 static bool setwarpRunState(pxConfig *config, psS64 warp_id, const char *state)1002 {1003 PS_ASSERT_PTR_NON_NULL(state, false);1004 1005 // check that state is a valid string value1006 if (!(1007 (strncmp(state, "run", 4) == 0)1008 || (strncmp(state, "stop", 5) == 0)1009 || (strncmp(state, "reg", 4) == 0)1010 )1011 ) {1012 psError(PS_ERR_UNKNOWN, false,1013 "invalid warpRun state: %s", state);1014 return false;1015 }1016 1017 char *query = "UPDATE warpRun SET state = '%s' WHERE warp_id = %" PRId64;1018 if (!p_psDBRunQuery(config->dbh, query, state, warp_id)) {1019 psError(PS_ERR_UNKNOWN, false,1020 "failed to change state for warp_id %" PRId64, warp_id);1021 return false;1022 }1023 1024 return true;1025 }1026 1027 1028 1001 static bool isValidMode(pxConfig *config, const char *mode) 1029 1002 {
Note:
See TracChangeset
for help on using the changeset viewer.
