[calamares] Improve "crash self" functionality

Instead of UB, use POSIX signals and terminate the Calamares
process with a recognizable signal number (TRAP, which is
highly unusual).
This commit is contained in:
Adriaan de Groot 2024-02-27 00:08:01 +01:00
parent 2555b5baf4
commit 9925d6666f

View File

@ -33,14 +33,15 @@
#include <QTreeView>
#include <QWidget>
#include <signal.h>
/**
* @brief crash makes Calamares crash immediately.
*/
static void
crash()
{
volatile int* a = nullptr;
*a = 1;
kill(getpid(), SIGTRAP);
}
/// @brief Print out the widget tree (names) in indented form.