Changeset 13967 for branches/backtrack/ippTools/src/regtool.c
- Timestamp:
- Jun 25, 2007, 10:19:18 AM (19 years ago)
- File:
-
- 1 edited
-
branches/backtrack/ippTools/src/regtool.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/backtrack/ippTools/src/regtool.c
r13617 r13967 282 282 return false; 283 283 } 284 psFree(object); 284 285 // insert the rawImfile object into the database 285 286 if (!rawImfileInsertObject(config->dbh, imfile)) { … … 290 291 psError(PS_ERR_UNKNOWN, false, "failed to insert row into the database"); 291 292 psFree(imfile); 292 psFree(object);293 293 psFree(output); 294 294 return false; 295 295 } 296 296 psFree(imfile); 297 // remove the neImfile object from the database298 if (!newImfileDeleteObject(config->dbh, object)) {299 // rollback300 if (!psDBRollback(config->dbh)) {301 psError(PS_ERR_UNKNOWN, false, "database error");302 }303 psError(PS_ERR_UNKNOWN, false, "failed to delete row from the database");304 psFree(object);305 psFree(output);306 return false;307 }308 psFree(object);309 297 } 310 298 … … 573 561 } 574 562 if (!psArrayLength(output)) { 575 ps Trace("regtool", PS_LOG_INFO, "norows found");563 psError(PS_ERR_UNKNOWN, false, "no pending newExp rows found"); 576 564 psFree(output); 577 return true; 578 } 579 580 // start a transaction so we don't end up with an exp in both rawExp & 581 // newExp 565 return false; 566 } 567 582 568 if (!psDBTransaction(config->dbh)) { 583 569 psError(PS_ERR_UNKNOWN, false, "database error"); … … 603 589 return false; 604 590 } 591 psFree(newExp); 605 592 606 593 // insert the rawExp object into the database … … 612 599 psError(PS_ERR_UNKNOWN, false, "database error"); 613 600 psFree(rawExp); 614 psFree(newExp);615 601 psFree(output); 616 602 return false; 617 603 } 618 604 psFree(rawExp); 619 620 // delete the newExp object from the database621 if (!newExpDeleteObject(config->dbh, newExp)) {622 // rollback623 if (!psDBRollback(config->dbh)) {624 psError(PS_ERR_UNKNOWN, false, "database error");625 }626 psError(PS_ERR_UNKNOWN, false, "database error");627 psFree(newExp);628 psFree(output);629 return false;630 }631 632 psFree(newExp);633 605 634 606 // if this is a detrend image don't put it in the chip queue (and we're 635 607 // done) 636 608 if (detrend) { 609 // set the state for the newExp to stop 610 if (!pxnewExpSetState(config, exp_tag, "stop")) { 611 // rollback 612 if (!psDBRollback(config->dbh)) { 613 psError(PS_ERR_UNKNOWN, false, "database error"); 614 } 615 psError(PS_ERR_UNKNOWN, false, "failed to change newExp.state for exp_tag: %s", exp_tag); 616 psFree(output); 617 return false; 618 } 637 619 continue; 638 620 } … … 648 630 return false; 649 631 } 650 } 651 632 633 // set the state for the newExp to stop 634 if (!pxnewExpSetState(config, exp_tag, "stop")) { 635 // rollback 636 if (!psDBRollback(config->dbh)) { 637 psError(PS_ERR_UNKNOWN, false, "database error"); 638 } 639 psError(PS_ERR_UNKNOWN, false, "failed to change newExp.state for exp_tag: %s", exp_tag); 640 psFree(output); 641 return false; 642 } 643 } 652 644 psFree(output); 653 645
Note:
See TracChangeset
for help on using the changeset viewer.
