URI: 
       Move to sigaction. Raise SIGWINCH on HUP for ncurses. - catpoint - Catpoint simple presenting software.
  HTML git clone git://bitreich.org/catpoint/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/catpoint/
   DIR Log
   DIR Files
   DIR Refs
   DIR Tags
   DIR README
   DIR LICENSE
       ---
   DIR commit 0ebd046cc4dc1cfca5e7120fa2115354efb0a87f
   DIR parent 6649dc02de2035e52c61b3e62cc543fd6bfdb1a7
  HTML Author: Christoph Lohmann <20h@r-36.net>
       Date:   Sun, 20 Dec 2020 17:20:03 +0100
       
       Move to sigaction. Raise SIGWINCH on HUP for ncurses.
       
       Thanks Bob for the sigaction suggestion!
       
       Diffstat:
         M Makefile                            |       2 +-
         M catpoint.c                          |      23 +++++++++++++++++------
       
       2 files changed, 18 insertions(+), 7 deletions(-)
       ---
   DIR diff --git a/Makefile b/Makefile
       @@ -12,7 +12,7 @@ MANPREFIX = ${PREFIX}/share/man
        
        # use system flags.
        CATPOINT_CFLAGS = ${CFLAGS}
       -CATPOINT_CPPFLAGS = ${CPPFLAGS}
       +CATPOINT_CPPFLAGS = ${CPPFLAGS} -D_DEFAULT_SOURCE
        CATPOINT_LDFLAGS = ${LDFLAGS} -lncursesw
        # Gentoo
        #CATPOINT_LDFLAGS = ${LDFLAGS} -lncursesw -ltinfow
   DIR diff --git a/catpoint.c b/catpoint.c
       @@ -61,18 +61,29 @@ reloadcurrentslide(int sig)
        {
                loadcurrentslide(slidefiles, currentslide);
        
       -        if (sig == SIGHUP)
       -                raise(SIGWINCH); /* Redisplay slide. */
       +        if (sig == SIGHUP) {
       +                /* Make ncurses redisplay slide. */
       +                if (raise(SIGWINCH) < 0)
       +                        err(1, "raise");
       +        }
        }
        
        void
        setsignal()
        {
       -        signal(SIGHUP, reloadcurrentslide);
       +        struct sigaction sa;
       +
       +        memset(&sa, 0, sizeof(sa));
       +        sigemptyset(&sa.sa_mask);
       +        sa.sa_flags = 0;
       +
       +        sa.sa_handler = cleanup;
       +        sigaction(SIGINT, &sa, NULL);
       +        sigaction(SIGQUIT, &sa, NULL);
       +        sigaction(SIGTERM, &sa, NULL);
        
       -        signal(SIGINT, cleanup);
       -        signal(SIGQUIT, cleanup);
       -        signal(SIGTERM, cleanup);
       +        sa.sa_handler = reloadcurrentslide;
       +        sigaction(SIGHUP, &sa, NULL);
        }
        
        int