Revised error handling

- Functions warn() and die() replaced by GNU-like error(3) function
- Register cleanup() with atexit(3)
- Functions called by cleanup() are marked with CLEANUP and are not allowed to
  call exit(3)
This commit is contained in:
Bert Münnich
2015-10-28 23:03:37 +01:00
parent 851e4288c1
commit d3a70a285d
12 changed files with 106 additions and 136 deletions

View File

@ -30,7 +30,6 @@
#define _IMAGE_CONFIG
#include "config.h"
void cleanup(void);
void remove_file(int, bool);
void load_image(int);
void open_info(void);
@ -64,7 +63,6 @@ bool cg_quit(arg_t _)
printf("%s\n", files[i].name);
}
}
cleanup();
exit(EXIT_SUCCESS);
}