Improves the -G, --gui output.

This commit is contained in:
Andrea Mazzoleni 2013-09-30 22:24:30 +02:00
parent 750e21ec87
commit d35beda689
10 changed files with 165 additions and 29 deletions

29
check.c
View file

@ -1650,6 +1650,35 @@ bail:
printf("Everything OK\n");
}
if (state->opt.gui) {
fprintf(stdlog, "summary:error:%u\n", error);
if (fix)
fprintf(stdlog, "summary:error_recovered:%u\n", recovered_error);
if (check)
fprintf(stdlog, "summary:error_unrecoverable:%u\n", unrecoverable_error);
if (fix) {
if (error + recovered_error + unrecoverable_error == 0)
fprintf(stdlog, "summary:exit:ok\n");
else if (unrecoverable_error == 0)
fprintf(stdlog, "summary:exit:recovered\n");
else
fprintf(stdlog, "summary:exit:unrecoverable\n");
} else if (check) {
if (error + unrecoverable_error == 0)
fprintf(stdlog, "summary:exit:ok\n");
else if (unrecoverable_error == 0)
fprintf(stdlog, "summary:exit:recoverable\n");
else
fprintf(stdlog, "summary:exit:unrecoverable\n");
} else { /* audit only */
if (error == 0)
fprintf(stdlog, "summary:exit:ok\n");
else
fprintf(stdlog, "summary:exit:error\n");
}
fflush(stdlog);
}
free(failed);
free(failed_map);
free(handle);