Removed all instances of crash_prog()
crash_prog was introduced to force-crash a userspace program since _exit may not yet be implemented. However, the new versions of OS161 already have the exact same logic as crash_prog in stdlib/exit.
This commit is contained in:
@@ -140,7 +140,6 @@ verr(int exitcode, const char *fmt, va_list ap)
|
||||
__printerr(1, fmt, ap);
|
||||
exit(exitcode);
|
||||
// exit() didn't work.
|
||||
crash_prog();
|
||||
}
|
||||
|
||||
/* errx/verrx: don't use errno, but do then exit */
|
||||
@@ -150,7 +149,6 @@ verrx(int exitcode, const char *fmt, va_list ap)
|
||||
__printerr(0, fmt, ap);
|
||||
exit(exitcode);
|
||||
// exit() didn't work.
|
||||
crash_prog();
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -193,12 +191,3 @@ errx(int exitcode, const char *fmt, ...)
|
||||
verrx(exitcode, fmt, ap);
|
||||
va_end(ap);
|
||||
}
|
||||
|
||||
void
|
||||
crash_prog(void)
|
||||
{
|
||||
// Guru: Since exit() may not yet be implemented, just trigger a
|
||||
// failure so things don't fall through to a success print
|
||||
nprintf("Accessing invalid memory location to trigger failure\n");
|
||||
tprintf("%d", *((int *) 0xd34db33f));
|
||||
}
|
||||
|
Reference in New Issue
Block a user