[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:
parent
2555b5baf4
commit
9925d6666f
@ -33,14 +33,15 @@
|
|||||||
#include <QTreeView>
|
#include <QTreeView>
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
|
|
||||||
|
#include <signal.h>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief crash makes Calamares crash immediately.
|
* @brief crash makes Calamares crash immediately.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
crash()
|
crash()
|
||||||
{
|
{
|
||||||
volatile int* a = nullptr;
|
kill(getpid(), SIGTRAP);
|
||||||
*a = 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// @brief Print out the widget tree (names) in indented form.
|
/// @brief Print out the widget tree (names) in indented form.
|
||||||
|
Loading…
Reference in New Issue
Block a user