From ff06bedf007a48407b728e9d35dc4bd2daad8314 Mon Sep 17 00:00:00 2001 From: Laxmi Devi Date: Thu, 24 May 2018 15:04:23 +0530 Subject: Use sigaction() instead of signal() Issue is that even after ctrl+c, fgets is waiting for a newline. See signal(7) for details. We have to either use siginterrupt() together with signal(), or use sigaction() instead of signal() for registering the signal handler, in order to disable restarting a read() system call after a signal. Signed-off-by: Laxmi Devi Signed-off-by: Timo Wischer --- wscript | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'wscript') diff --git a/wscript b/wscript index 622df5c..c84f891 100644 --- a/wscript +++ b/wscript @@ -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']) -- cgit v1.2.1