From c707e49bd36dcf8e1e53d1e314347549605ee847 Mon Sep 17 00:00:00 2001 From: nick black Date: Wed, 17 Nov 2021 03:08:57 -0500 Subject: [PATCH] [signals] set up NCKEY_SIGNAL on SIGCONT #281 --- src/lib/in.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/lib/in.c b/src/lib/in.c index a9c30574c..4e8acfc14 100644 --- a/src/lib/in.c +++ b/src/lib/in.c @@ -25,12 +25,15 @@ // FIXME still need to: // probably want pipes/eventfds rather than SIGCONT +static sig_atomic_t cont_seen; static sig_atomic_t resize_seen; // called for SIGWINCH and SIGCONT, and causes block_on_input to return void sigwinch_handler(int signo){ if(signo == SIGWINCH){ resize_seen = signo; + }else if(signo == SIGCONT){ + cont_seen = signo; } } @@ -1904,6 +1907,13 @@ process_ibuf(inputctx* ictx){ load_ncinput(ictx, &tni, 0); resize_seen = 0; } + if(cont_seen){ + ncinput tni = { + .id = NCKEY_SIGNAL, + }; + load_ncinput(ictx, &tni, 0); + cont_seen = 0; + } if(ictx->tbufvalid){ // we could theoretically do this in parallel with process_bulk, but it // hardly seems worthwhile without breaking apart the fetches of input.