mirror of
https://github.com/tio/tio.git
synced 2026-05-01 14:57:59 +02:00
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:
parent
4e2bcde010
commit
ad551b363e
6 changed files with 106 additions and 81 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue