Commit 3db2b230 authored by Paul Sokolovsky's avatar Paul Sokolovsky
Browse files

unix/unix_mphal: Properly initialize struct sigaction.

This solves long-standing non-deterministic bug, which manifested itself
on x86 32-bit (at least of reported cases) - segfault on Ctrl+C (i.e.
SIGINT).
parent 02fa8dff
......@@ -53,6 +53,7 @@ void mp_hal_set_interrupt_char(char c) {
#ifndef _WIN32
// enable signal handler
struct sigaction sa;
memset(&sa, 0, sizeof(sa));
sa.sa_handler = sighandler;
sigemptyset(&sa.sa_mask);
sigaction(SIGINT, &sa, NULL);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment