panic() cleanup.
this change
- makes panic() variadic, doing full printf() formatting -
no more NO_NUM, and no more separate printf() statements
needed to print extra info (or something in hex) before panicing
- unifies panic() - same panic() name and usage for everyone -
vm, kernel and rest have different names/syntax currently
in order to implement their own luxuries, but no longer
- throws out the 1st argument, to make source less noisy.
the panic() in syslib retrieves the server name from the kernel
so it should be clear enough who is panicing; e.g.
panic("sigaction failed: %d", errno);
looks like:
at_wini(73130): panic: sigaction failed: 0
syslib:panic.c: stacktrace: 0x74dc 0x2025 0x100a
- throws out report() - printf() is more convenient and powerful
- harmonizes/fixes the use of panic() - there were a few places
that used printf-style formatting (didn't work) and newlines
(messes up the formatting) in panic()
- throws out a few per-server panic() functions
- cleans up a tie-in of tty with panic()
merging printf() and panic() statements to be done incrementally.
This commit is contained in:
+6
-10
@@ -73,17 +73,15 @@ PUBLIC int do_exec_newmem()
|
||||
return EPERM;
|
||||
|
||||
proc_e= m_in.EXC_NM_PROC;
|
||||
if (pm_isokendpt(proc_e, &proc_n) != OK)
|
||||
{
|
||||
panic(__FILE__, "do_exec_newmem: got bad endpoint",
|
||||
proc_e);
|
||||
if (pm_isokendpt(proc_e, &proc_n) != OK) {
|
||||
panic("do_exec_newmem: got bad endpoint: %d", proc_e);
|
||||
}
|
||||
rmp= &mproc[proc_n];
|
||||
ptr= m_in.EXC_NM_PTR;
|
||||
r= sys_datacopy(who_e, (vir_bytes)ptr,
|
||||
SELF, (vir_bytes)&args, sizeof(args));
|
||||
if (r != OK)
|
||||
panic(__FILE__, "do_exec_newmem: sys_datacopy failed", r);
|
||||
panic("do_exec_newmem: sys_datacopy failed: %d", r);
|
||||
|
||||
if((r=vm_exec_newmem(proc_e, &args, sizeof(args), &stack_top, &flags)) == OK) {
|
||||
allow_setuid= 0; /* Do not allow setuid execution */
|
||||
@@ -127,10 +125,8 @@ PUBLIC int do_execrestart()
|
||||
return EPERM;
|
||||
|
||||
proc_e= m_in.EXC_RS_PROC;
|
||||
if (pm_isokendpt(proc_e, &proc_n) != OK)
|
||||
{
|
||||
panic(__FILE__, "do_execrestart: got bad endpoint",
|
||||
proc_e);
|
||||
if (pm_isokendpt(proc_e, &proc_n) != OK) {
|
||||
panic("do_execrestart: got bad endpoint: %d", proc_e);
|
||||
}
|
||||
rmp= &mproc[proc_n];
|
||||
result= m_in.EXC_RS_RESULT;
|
||||
@@ -191,6 +187,6 @@ int result;
|
||||
new_sp= (char *)rmp->mp_procargs;
|
||||
pc= 0; /* for now */
|
||||
r= sys_exec(rmp->mp_endpoint, new_sp, rmp->mp_name, pc);
|
||||
if (r != OK) panic(__FILE__, "sys_exec failed", r);
|
||||
if (r != OK) panic("sys_exec failed: %d", r);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user