Changeset 10983
- Timestamp:
- Jan 8, 2007, 3:42:25 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/ppStats/src/ppStatsStandAlone.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppStats/src/ppStatsStandAlone.c
r10441 r10983 15 15 int main(int argc, char *argv[]) 16 16 { 17 int status =EXIT_SUCCESS;17 psExit status = PS_EXIT_SUCCESS; 18 18 19 19 psLibInit(NULL); … … 22 22 // Parse the configuration and arguments 23 23 pmConfig *config = pmConfigRead(&argc, argv, PPSTATS_RECIPE); 24 if (!config) { 25 psError(PS_ERR_UNKNOWN, false, "Unable to read configuration.\n"); 26 exit(PS_EXIT_CONFIG_ERROR); 27 } 24 28 25 29 // Get the options, open the files 26 30 ppStatsData *data = ppStatsSetupFromArgs(config); 31 if (!data) { 32 psError(PS_ERR_UNKNOWN, false, "Unable to parse command-line arguments.\n"); 33 exit(PS_EXIT_CONFIG_ERROR); 34 } 27 35 28 36 // Output filename is optional … … 35 43 if (!outFile) { 36 44 psLogMsg("ppStats", PS_LOG_ERROR, "Unable to open output file %s\n", outName); 37 status = EXIT_FAILURE;45 status = PS_EXIT_DATA_ERROR; 38 46 goto die; 39 47 } 40 48 } else { 41 49 psLogMsg("ppStats", PS_LOG_ERROR, "Unable to open output file.\n"); 42 status = EXIT_FAILURE;50 status = PS_EXIT_DATA_ERROR; 43 51 goto die; 44 52 } … … 51 59 psLogMsg("ppStats", PS_LOG_ERROR, "No output.\n"); 52 60 psFree(results); 53 status = EXIT_FAILURE;61 status = PS_EXIT_UNKNOWN_ERROR; 54 62 goto die; 55 63 } … … 60 68 psLogMsg("ppStats", PS_LOG_ERROR, "Unable to generate configuration file with result.\n"); 61 69 psFree(results); 62 status = EXIT_FAILURE;70 status = PS_EXIT_SYS_ERROR; 63 71 goto die; 64 72 }
Note:
See TracChangeset
for help on using the changeset viewer.
