Skip to content

Commit

Permalink
lib: core: reset SIGINT in the child
Browse files Browse the repository at this point in the history
If we're run, e.g., directly from another lua script, then SIGINT may be
ignored.  Reset SIGINT's disposition so that the parent can kill it upon
respawn or finishing the .orch script.

Signed-off-by: Kyle Evans <[email protected]>
  • Loading branch information
kevans91 committed Jan 25, 2024
1 parent 8241525 commit ca35f1f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/core/orch_spawn.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <err.h>
#include <errno.h>
#include <fcntl.h>
#include <signal.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
Expand Down Expand Up @@ -248,6 +249,8 @@ orch_exec(int argc __unused, const char *argv[], struct termios *t)
{
int error;

signal(SIGINT, SIG_DFL);

/*
* Register a couple of events that the script may want to use:
* - IPC_TERMIOS_INQUIRY: sent our terminal attributes back over.
Expand Down

0 comments on commit ca35f1f

Please sign in to comment.