2019-06-19 21:41:22 +02:00
|
|
|
// The OS/K Team licenses this file to you under the MIT license.
|
|
|
|
// See the LICENSE file in the project root for more information.
|
|
|
|
|
2019-06-21 22:19:55 +02:00
|
|
|
#include <pc/device.h>
|
2019-06-20 17:44:48 +02:00
|
|
|
#include <pc/console.h>
|
2019-06-19 21:41:22 +02:00
|
|
|
|
|
|
|
void die(int code)
|
|
|
|
{
|
|
|
|
dying = 1;
|
|
|
|
|
|
|
|
enable_stdin_echoing();
|
|
|
|
|
|
|
|
if (main_ctx.mp)
|
|
|
|
free(main_ctx.mp);
|
|
|
|
|
2019-06-19 23:16:30 +02:00
|
|
|
console_exit(&main_ctx);
|
|
|
|
|
2019-06-19 21:41:22 +02:00
|
|
|
//
|
|
|
|
// Shut down devices
|
|
|
|
//
|
|
|
|
if (devfiniall(&main_ctx) < 0)
|
|
|
|
{
|
|
|
|
logerr("Couldn't deinitialize devices\n");
|
|
|
|
exit(-100 - code);
|
|
|
|
}
|
|
|
|
|
|
|
|
exit(code);
|
|
|
|
}
|