Changeset 27107 for trunk/ppStack/src/ppStack.c
- Timestamp:
- Feb 26, 2010, 3:04:19 PM (16 years ago)
- File:
-
- 1 edited
-
trunk/ppStack/src/ppStack.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppStack/src/ppStack.c
r27076 r27107 58 58 // Common code for the death. 59 59 { 60 psExit exitValue = PS_EXIT_SUCCESS; // Exit value for program 61 psErrorCode errorCode = psErrorCodeLast(); // Error code 62 if (errorCode != PS_ERR_NONE) { 63 psErrorStackPrint(stderr, "Unable to perform stack."); 64 switch (errorCode) { 65 case PPSTACK_ERR_UNKNOWN: 66 case PS_ERR_UNKNOWN: 67 exitValue = PS_EXIT_UNKNOWN_ERROR; 68 break; 69 case PS_ERR_IO: 70 case PS_ERR_DB_CLIENT: 71 case PS_ERR_DB_SERVER: 72 case PS_ERR_BAD_FITS: 73 case PS_ERR_OS_CALL_FAILED: 74 case PPSTACK_ERR_IO: 75 exitValue = PS_EXIT_SYS_ERROR; 76 break; 77 case PS_ERR_BAD_PARAMETER_VALUE: 78 case PS_ERR_BAD_PARAMETER_TYPE: 79 case PS_ERR_BAD_PARAMETER_NULL: 80 case PS_ERR_BAD_PARAMETER_SIZE: 81 case PPSTACK_ERR_ARGUMENTS: 82 case PPSTACK_ERR_CONFIG: 83 exitValue = PS_EXIT_CONFIG_ERROR; 84 break; 85 case PPSTACK_ERR_PSF: 86 case PPSTACK_ERR_REJECTED: 87 case PPSTACK_ERR_DATA: 88 exitValue = PS_EXIT_DATA_ERROR; 89 break; 90 case PS_ERR_UNEXPECTED_NULL: 91 case PS_ERR_PROGRAMMING: 92 case PPSTACK_ERR_NOT_IMPLEMENTED: 93 case PPSTACK_ERR_PROG: 94 default: 95 // It's a programming error if we're not dealing with the error correctly 96 exitValue = PS_EXIT_PROG_ERROR; 97 break; 98 } 99 } 60 psExit exitValue = ppStackExitCode(); // Exit code 100 61 101 62 // Ensure everything closes … … 107 68 if (!ppStackFilesIterateUp(config)) { 108 69 psErrorStackPrint(stderr, "Unable to close files."); 70 if (exitValue == PS_EXIT_SUCCESS) { 71 exitValue = ppStackExitCode(); 72 } 73 } 74 } 75 76 // Dump configuration 77 bool mdok; // Status of MD lookup 78 psString dump = psMetadataLookupStr(&mdok, config->arguments, "DUMP_CONFIG"); // File for config 79 if (dump && !pmConfigDump(config, dump)) { 80 psErrorStackPrint(stderr, "Unable to dump configuration."); 81 if (exitValue == PS_EXIT_SUCCESS) { 82 exitValue = ppStackExitCode(); 109 83 } 110 84 }
Note:
See TracChangeset
for help on using the changeset viewer.
