IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 15, 2007, 3:52:15 PM (19 years ago)
Author:
jhoblitt
Message:

handle p0toolConfig() errors properly

File:
1 edited

Legend:

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

    r11816 r11842  
    5656int main(int argc, char **argv)
    5757{
    58     psExit exit_status = PS_EXIT_SUCCESS;
    59 
    6058    psLibInit(NULL);
    6159
    6260    pxConfig *config = p0toolConfig(NULL, argc, argv);
     61    if (!config) {
     62        psError(PXTOOLS_ERR_CONFIG, false, "failed to configure");
     63        goto FAIL;
     64    }
    6365
    6466    switch (config->mode) {
     
    7981    psLibFinalize();
    8082
    81     exit(exit_status);
     83    exit(EXIT_SUCCESS);
    8284
    8385FAIL:
    84     // use the top-most error to determine the exit status
    85     exit_status = pxerrorGetExitStatus();
     86    psErrorStackPrint(stderr, "\n");
     87    int exit_status = pxerrorGetExitStatus();
    8688
    8789    psFree(config);
    8890    pmConfigDone();
    89     psErrorStackPrint(stderr, "\n");
    9091    psLibFinalize();
    9192
Note: See TracChangeset for help on using the changeset viewer.