When an ell main loop based process is spun off as a child
and the parent process dies due to a segfault, the child process
is still left running and needs to detect the segfault condition.
To address this need, add watch and signal handler for SIGSEGV.
---
ell/main.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/ell/main.c b/ell/main.c
index a479b74..712cfb7 100644
--- a/ell/main.c
+++ b/ell/main.c
@@ -619,6 +619,14 @@ static void sigterm_handler(void *user_data)
data->callback(SIGTERM, data->user_data);
}
+static void sigsegv_handler(void *user_data)
+{
+ struct signal_data *data = user_data;
+
+ if (data->callback)
+ data->callback(SIGSEGV, data->user_data);
+}
+