Cleaned up src/lib/utils library. Renamed server_ functions to more logical

names. All system processes can now either use panic() or report() from
libutils, or redefine their own function. Assertions are done via the standard
<assert.h> functionality.
This commit is contained in:
Jorrit Herder
2005-06-01 14:31:00 +00:00
parent 75689debe3
commit 6d23f072f3
58 changed files with 364 additions and 498 deletions

30
lib/utils/panic.c Normal file
View File

@@ -0,0 +1,30 @@
#include "utils.h"
/*===========================================================================*
* panic *
*===========================================================================*/
PUBLIC void panic(who, mess, num)
char *who; /* server identification */
char *mess; /* message format string */
int num; /* number to go with format string */
{
/* Something awful has happened. Panics are caused when an internal
* inconsistency is detected, e.g., a programming error or illegal
* value of a defined constant.
*/
message m;
if (NULL != who && NULL != mess) {
if (num != NO_NUM) {
printf("Panic in %s: %s: %d\n", who, mess, num);
} else {
printf("Panic in %s: %s\n", who, mess);
}
}
m.m_type = SYS_EXIT;
m.EXIT_STATUS = 1;
_taskcall(SYSTASK, SYS_EXIT, &m);
/* never reached */
}