Changeset 25800 for trunk/ippTools/src/stacktool.c
- Timestamp:
- Oct 7, 2009, 4:25:35 PM (17 years ago)
- File:
-
- 1 edited
-
trunk/ippTools/src/stacktool.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/src/stacktool.c
r25691 r25800 48 48 49 49 static bool setstackRunState(pxConfig *config, psS64 stack_id, const char *state); 50 static bool setstackRunStateByLabel(pxConfig *config, const char *label, const char *state); 50 51 51 52 # define MODECASE(caseName, func) \ … … 569 570 PS_ASSERT_PTR_NON_NULL(config, false); 570 571 571 PXOPT_LOOKUP_S64(stack_id, config->args, "-stack_id", true, false);572 PXOPT_LOOKUP_S64(stack_id, config->args, "-stack_id", false, false); 572 573 PXOPT_LOOKUP_STR(state, config->args, "-state", true, false); 573 574 if (state) { 574 PXOPT_LOOKUP_STR(label, config->args, "-label", false, false); 575 576 // Hack-y work around to make stacktool more like the other tools, without breaking other stuff (hopefully). 577 578 if ((state)&&(stack_id)) { 575 579 // set detRun.state to state 576 580 return setstackRunState(config, stack_id, state); 577 581 } 578 582 579 return true; 583 if ((state)&&(label)) { 584 return setstackRunStateByLabel(config, label, state); 585 } 586 587 psError(PS_ERR_UNKNOWN, false, "Required options not found."); 588 return false; 580 589 } 581 590 … … 1006 1015 } 1007 1016 1017 static bool setstackRunStateByLabel(pxConfig *config, const char *label, const char *state) 1018 { 1019 PS_ASSERT_PTR_NON_NULL(state, false); 1020 1021 // check that state is a valid string value 1022 if (!pxIsValidState(state)) { 1023 psError(PS_ERR_UNKNOWN, false, "invalid stackRun state: %s", state); 1024 return false; 1025 } 1026 1027 char *query = "UPDATE stackRun SET state = '%s' WHERE label = '%s'"; 1028 if (!p_psDBRunQueryF(config->dbh, query, state, label)) { 1029 psError(PS_ERR_UNKNOWN, false, 1030 "failed to change state for label %s", label); 1031 return false; 1032 } 1033 1034 return true; 1035 } 1036 1008 1037 static bool pendingcleanuprunMode(pxConfig *config) 1009 1038 {
Note:
See TracChangeset
for help on using the changeset viewer.
