In case the domu runs very quickly, there will be a complete failure
to observe any output. Therefore, in case we exit with val != 0,
sleep a bit. This is a cheap and dirty workaround.
_exit(int eval)
{
/* XXX this duplicates _app_main / callmain cleanup */
- minios_printk("\n=== _exit(%d) called ===\n", eval);
+ if (eval) {
+ minios_printk("\n=== ERROR: _exit(%d) called ===\n", eval);
+ /* XXX: work around the console being slow to attach */
+ sleep(1);
+ } else {
+ minios_printk("\n=== _exit(%d) called ===\n", eval);
+ }
_rumprun_deconfig();
_netbsd_fini();
minios_stop_kernel();