Branch data Line data Source code
1 : : #include "precizer.h"
2 : :
3 : : /**
4 : : *
5 : : * Print out an exit status
6 : : *
7 : : */
8 : 377 : int exit_status(
9 : : Return status,
10 : : char * const *argv)
11 : : {
12 : : /*
13 : : *
14 : : * Exit
15 : : *
16 : : */
17 : :
18 : 377 : const char *application_file_name = basename(argv[0]);
19 : :
20 [ + + ]: 377 : if(global_interrupt_flag == true)
21 : : {
22 : 4 : slog(EVERY,"The %s has been interrupted smoothly. All data remain in integrity condition\n",application_file_name);
23 : 4 : slog(EVERY,"Exit status » %s\n",show_status(status));
24 : 4 : return((int)status);
25 : : } else {
26 [ + + ]: 373 : if(TRIUMPH & status)
27 : : {
28 [ + + ]: 309 : if((INFO & status) == 0)
29 : : {
30 : 279 : slog(EVERY,"The %s completed as expected\n",application_file_name);
31 : : }
32 : 309 : slog(EVERY,"Exit status » %s\n",show_status(status));
33 : 309 : slog(REGULAR,"Enjoy your life!\n");
34 : 309 : return((int)COMPLETED);
35 : : } else {
36 : 64 : slog(ERROR,"The %s process terminated unexpectedly due to an error\n",application_file_name);
37 : 64 : slog(ERROR,"Exit status » %s\n",show_status(status));
38 : 64 : return((int)status);
39 : : }
40 : : }
41 : : }
|