Print exit status at end of main output line.

This commit is contained in:
Jim Hague 2018-01-15 10:21:39 +00:00
parent 5d4bc8bc96
commit c0d7d2c279
1 changed files with 18 additions and 0 deletions

View File

@ -983,6 +983,24 @@ int main(int ATTR_UNUSED(ac), char *av[])
++f) { ++f) {
if (strcmp(testname, f->name) == 0) { if (strcmp(testname, f->name) == 0) {
exit_value_t xit = f->func(&test_info, av); exit_value_t xit = f->func(&test_info, av);
switch(xit) {
case 0:
fputs(" OK", test_info.errout);
break;
case 1:
fputs(" WARNING", test_info.errout);
break;
case 2:
fputs(" CRITICAL", test_info.errout);
break;
default:
fputs(" UNKNOWN", test_info.errout);
break;
}
fputc('\n', test_info.errout); fputc('\n', test_info.errout);
exit(xit); exit(xit);
} }