Type _exit and abort before generating a trap.

This commit is contained in:
Philip Homburg 2007-04-23 12:13:51 +00:00
parent 4ce9ca03cf
commit 4ce2267dd3

View file

@ -30,13 +30,21 @@ int num; /* number to go with format string */
}
}
/* Try exit */
_exit(1);
/* Try to signal ourself */
abort();
/* If exiting nicely through PM fails for some reason, try to
* commit suicide. E.g., message to PM might fail due to deadlock.
*/
printf("panic: trying exception\n");
suicide = (void (*)(void)) -1;
suicide();
/* If committing suicide fails for some reason, hang. */
printf("panic: for ever and ever\n");
for(;;) { }
}