diff options
author | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2015-12-17 23:17:07 +0200 |
---|---|---|
committer | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2015-12-17 23:24:35 +0200 |
commit | 3db2b230602b0140b3ea430c61d415335d939274 (patch) | |
tree | 6914072be60c3851558be6c9eb2a4fc962ed66b3 | |
parent | 02fa8dff859be40443f16baf9bc7431878f34ec1 (diff) | |
download | micropython-3db2b230602b0140b3ea430c61d415335d939274.tar.gz micropython-3db2b230602b0140b3ea430c61d415335d939274.zip |
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).
-rw-r--r-- | unix/unix_mphal.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/unix/unix_mphal.c b/unix/unix_mphal.c index 4ea682f0c8..523e34dd8d 100644 --- a/unix/unix_mphal.c +++ b/unix/unix_mphal.c @@ -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); |