diff options
-rw-r--r-- | NEWS | 3 | ||||
-rw-r--r-- | src/jalv.c | 10 | ||||
-rw-r--r-- | wscript | 6 |
3 files changed, 18 insertions, 1 deletions
@@ -4,10 +4,11 @@ jalv (1.6.1) unstable; * Add jalv -i option to ignore stdin for background use * Fix Jack deactivation * Fix potential crash when closed with worker (thanks JP Cimalando) + * Fix potential hang after Ctrl-c in console interface (thanks Laxmi Devi) * Add support for underscore in port names on command line (thanks Jośe Fernando Moyano) - -- David Robillard <d@drobilla.net> Thu, 20 Sep 2018 09:21:15 +0200 + -- David Robillard <d@drobilla.net> Thu, 20 Sep 2018 09:27:15 +0200 jalv (1.6.0) stable; @@ -878,8 +878,18 @@ main(int argc, char** argv) zix_sem_init(&jalv.paused, 0); zix_sem_init(&jalv.worker.sem, 0); +#ifdef HAVE_SIGACTION + struct sigaction action; + sigemptyset(&action.sa_mask); + action.sa_flags = 0; + action.sa_handler = signal_handler; + sigaction(SIGINT, &action, NULL); + sigaction(SIGTERM, &action, NULL); +#else + /* May not work in combination with fgets in the console interface */ signal(SIGINT, signal_handler); signal(SIGTERM, signal_handler); +#endif /* Find all installed plugins */ LilvWorld* world = lilv_world_new(); @@ -120,6 +120,12 @@ def configure(conf): define_name = 'HAVE_MLOCK', mandatory = False) + autowaf.check_function(conf, 'c', 'sigaction', + header_name = 'signal.h', + defines = defines, + define_name = 'HAVE_SIGACTION', + mandatory = False) + if conf.is_defined('HAVE_ISATTY') and conf.is_defined('HAVE_FILENO'): autowaf.define(conf, 'JALV_WITH_COLOR', 1) conf.env.append_unique('CFLAGS', ['-D_POSIX_C_SOURCE=200809L']) |