Skip to content

Commit

Permalink
Add back SA_NODEFER
Browse files Browse the repository at this point in the history
It turns out that you can only send one SIGINT without it. Duh. I'm an
idiot.

However, it actually may cause problems for editline, so only use it
when editline is not activated.

Signed-off-by: Gavin D. Howard <gavin@gavinhoward.com>
  • Loading branch information
gavinhoward committed Oct 16, 2023
1 parent 0792964 commit 536ed20
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/vm.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ bc_vm_jmp(void)
static void
bc_vm_sig(int sig)
{
(void) write(STDERR_FILENO, "Z", 1);

#if BC_ENABLE_EDITLINE
// Editline needs this to resize the terminal. This also needs to come first
// because a resize always needs to happen.
Expand Down Expand Up @@ -214,7 +216,7 @@ bc_vm_sigaction(void)
struct sigaction sa;

sigemptyset(&sa.sa_mask);
sa.sa_flags = 0;
sa.sa_flags = BC_ENABLE_EDITLINE ? 0 : SA_NODEFER;

// This mess is to silence a warning on Clang with regards to glibc's
// sigaction handler, which activates the warning here.
Expand Down

0 comments on commit 536ed20

Please sign in to comment.