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:
+2
-17
@@ -80,21 +80,6 @@ PUBLIC void main(void)
|
||||
}
|
||||
|
||||
|
||||
/*===========================================================================*
|
||||
* report *
|
||||
*===========================================================================*/
|
||||
PUBLIC void report(mess, num)
|
||||
char *mess; /* message format to print */
|
||||
int num; /* number to go with the message */
|
||||
{
|
||||
if (num != NO_NUM) {
|
||||
printf("IS: %s %d\n", mess, num);
|
||||
} else {
|
||||
printf("IS: %s\n", mess);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*===========================================================================*
|
||||
* init_server *
|
||||
*===========================================================================*/
|
||||
@@ -128,7 +113,7 @@ PRIVATE void get_work()
|
||||
int status = 0;
|
||||
status = receive(ANY, &m_in); /* this blocks until message arrives */
|
||||
if (OK != status)
|
||||
server_panic("IS","failed to receive message!", status);
|
||||
panic("IS","failed to receive message!", status);
|
||||
who = m_in.m_source; /* message arrived! set sender */
|
||||
callnr = m_in.m_type; /* set function call number */
|
||||
}
|
||||
@@ -145,7 +130,7 @@ int result; /* report result to replyee */
|
||||
m_out.m_type = result; /* build reply message */
|
||||
send_status = send(who, &m_out); /* send the message */
|
||||
if (OK != send_status)
|
||||
server_panic("IS", "unable to send reply!", send_status);
|
||||
panic("IS", "unable to send reply!", send_status);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user