IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 27, 2010, 1:37:11 PM (16 years ago)
Author:
bills
Message:

don't revert dependent faults with fault > 10 unless explicitly requested by the user

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippTools/src/pstamptool.c

    r28145 r28146  
    3030#include "pxdata.h"
    3131#include "pstamptool.h"
     32#include "pstamp.h"
    3233
    3334static bool adddatastoreMode(pxConfig *config);
     
    941942    PXOPT_LOOKUP_S16(fault, config->args, "-fault",  false, false);
    942943
    943     // By default only revert faults < 10 which are our "ipp exit codes"
     944    // By default only revert faults < PSTAMP_FIRST_ERROR_CODE which are our "ipp exit codes"
    944945    // codes larger than that are the pstamp request interface.
    945946    // Don't fault those unless -fault waa provided
    946     psString faultClause = "";
     947    psString faultClause = psStringCopy("");
    947948    if (!fault) {
    948         faultClause = " \nAND (pstampJob.fault < 10)";
     949        psStringAppend(&faultClause, " \nAND (pstampJob.fault < %d)", PSTAMP_FIRST_ERROR_CODE);
    949950    }
    950951
     
    963964
    964965    if (!p_psDBRunQueryF(config->dbh, query, faultClause)) {
    965         psError(PS_ERR_UNKNOWN, false, "database error");
    966         return false;
    967     }
     966        psFree(faultClause);
     967        psFree(query);
     968        psError(PS_ERR_UNKNOWN, false, "database error");
     969        return false;
     970    }
     971
     972    psFree(faultClause);
    968973
    969974    return true;
     
    13221327        return false;
    13231328    }
     1329
     1330    PXOPT_LOOKUP_S16(fault,      config->args, "-fault",          false, false);
     1331
    13241332    psString query = pxDataGet("pstamptool_revertdependent.sql");
    13251333    if (!query) {
     
    13331341    psFree(where);
    13341342
     1343    if (!fault) {
     1344        // unless asked to clear a specific fault value, restrict reverts to fault codes
     1345        // that are less than the minimum fault in the API
     1346        psStringAppend(&query, " AND (pstampDependent.fault < %d)", PSTAMP_FIRST_ERROR_CODE);
     1347    }
     1348
    13351349    if (!p_psDBRunQuery(config->dbh, query)) {
    13361350        psError(PS_ERR_UNKNOWN, false, "database error");
Note: See TracChangeset for help on using the changeset viewer.