Cleanup of error handling

Introduced consistent way of handling errors and printing error messages.

Also upgraded some warnings to errors.
This commit is contained in:
Martin Lund 2016-05-09 17:28:43 +02:00
parent 4e2bcde010
commit ad551b363e
6 changed files with 106 additions and 81 deletions

View file

@ -32,21 +32,18 @@ int main(int argc, char *argv[])
{
int status;
/* Install error exit handler */
atexit(&error_exit);
/* Parse options */
parse_options(argc, argv);
/* Configure output terminal */
configure_stdout();
/* Install error exit handler */
atexit(&error_exit);
/* Install log exit handler */
atexit(&log_exit);
/* Restore output terminal on exit */
atexit(&restore_stdout);
/* Create log file */
if (option.log)
log_open(option.log_filename);