Changeset 36981 for trunk/ippTools/src/remotetool.c
- Timestamp:
- Jul 8, 2014, 3:30:52 PM (12 years ago)
- File:
-
- 1 edited
-
trunk/ippTools/src/remotetool.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/src/remotetool.c
r36968 r36981 23 23 24 24 // Update 25 static bool dropcomponentMode(pxConfig *config); 25 26 static bool updaterunMode(pxConfig *config); 26 27 static bool updatepollMode(pxConfig *config); … … 49 50 MODECASE(REMOTETOOL_MODE_LISTRUN, listrunMode); 50 51 MODECASE(REMOTETOOL_MODE_LISTCOMPONENT, listcomponentMode); 52 MODECASE(REMOTETOOL_MODE_DROPCOMPONENT, dropcomponentMode); 51 53 MODECASE(REMOTETOOL_MODE_UPDATERUN, updaterunMode); 52 54 MODECASE(REMOTETOOL_MODE_UPDATEPOLL, updatepollMode); … … 314 316 // Update 315 317 318 static bool dropcomponentMode(pxConfig *config) 319 { 320 // Assert that we have a unique component to operate on. 321 PXOPT_LOOKUP_S64(remote_id,config->args, "-remote_id",true, false); 322 psAssert(remote_id,"This must exist for this mode to be safe."); 323 PXOPT_LOOKUP_S64(stage_id, config->args, "-stage_id", true, false); 324 psAssert(stage_id,"This must exist for this mode to be safe."); 325 326 psString query = pxDataGet("remotetool_dropcomponent.sql"); 327 if (!query) { 328 psError(PXTOOLS_ERR_SYS, false, "Failed to retreive SQL statement"); 329 return false; 330 } 331 332 if (!psDBTransaction(config->dbh)) { 333 psError(PS_ERR_UNKNOWN, false, "database error"); 334 return false; 335 } 336 337 if (!p_psDBRunQueryF(config->dbh, query, remote_id, stage_id)) { 338 psError(PS_ERR_UNKNOWN, false, "Database error"); 339 psFree(query); 340 return false; 341 } 342 psFree(query); 343 344 345 346 // point of no return 347 if (!psDBCommit(config->dbh)) { 348 psError(PS_ERR_UNKNOWN, false, "database error"); 349 return false; 350 } 351 352 return true; 353 } 354 316 355 static bool updaterunMode(pxConfig *config) 317 356 {
Note:
See TracChangeset
for help on using the changeset viewer.
