Test the availability of SA_RESTART and use it conditionally.
This commit is contained in:
@@ -11,6 +11,7 @@ v.0.5dev (ongoing development)
|
||||
* Make all drivers using parallel port fail if they cannot get IO permission
|
||||
* Include <errno.h> instead of <sys/errno.h> everywhere (found by S. Klauer)
|
||||
* configure: Fix de-selecting of drivers
|
||||
* Build system: Add a check testing if SA_RESTART flag is available.
|
||||
|
||||
v0.5.3
|
||||
+ lcdexec: notification when called program finishes
|
||||
|
||||
@@ -884,6 +884,7 @@ AC_SUBST(enable_latex_dox)
|
||||
])
|
||||
|
||||
|
||||
dnl Check if a given flag is understood and add it to CFLAGS.
|
||||
dnl From: http://autoconf-archive.cryp.to/ax_cflags_gcc_option.html
|
||||
dnl Author: Guido Draheim <guidod@gmx.de>
|
||||
dnl Last Modified: 2003-11-04
|
||||
@@ -1029,3 +1030,17 @@ AC_DEFUN([AX_CFLAGS_GCC_OPTION],[ifelse(m4_bregexp([$2],[-]),-1,
|
||||
AC_DEFUN([AX_CXXFLAGS_GCC_OPTION],[ifelse(m4_bregexp([$2],[-]),-1,
|
||||
[AX_CXXFLAGS_GCC_OPTION_NEW($@)],[AX_CXXFLAGS_GCC_OPTION_OLD($@)])])
|
||||
|
||||
dnl
|
||||
dnl Check if system has SA_RESTART defined. Copied from GNU's make configure.
|
||||
dnl
|
||||
AC_DEFUN([LCD_SA_RESTART], [
|
||||
AC_CACHE_CHECK([for SA_RESTART], lcd_cv_sa_restart, [
|
||||
AC_TRY_COMPILE([#include <signal.h>],
|
||||
[return SA_RESTART;],
|
||||
lcd_cv_sa_restart=yes,
|
||||
lcd_cv_sa_restart=no)])
|
||||
if test "$lcd_cv_sa_restart" != no; then
|
||||
AC_DEFINE([HAVE_SA_RESTART], [1],
|
||||
[Define to 1 if <signal.h> defines the SA_RESTART constant.])
|
||||
fi
|
||||
])
|
||||
|
||||
@@ -157,7 +157,9 @@ int main(int argc, char **argv)
|
||||
|
||||
/* setup signal handlers for common signals */
|
||||
sigemptyset(&sa.sa_mask);
|
||||
#ifdef HAVE_SA_RESTART
|
||||
sa.sa_flags = SA_RESTART;
|
||||
#endif
|
||||
sa.sa_handler = exit_program;
|
||||
sigaction(SIGINT, &sa, NULL); // Ctrl-C
|
||||
sigaction(SIGTERM, &sa, NULL); // "regular" kill
|
||||
|
||||
@@ -120,7 +120,9 @@ int main(int argc, char **argv)
|
||||
|
||||
/* setup signal handlers for common signals */
|
||||
sigemptyset(&sa.sa_mask);
|
||||
#ifdef HAVE_SA_RESTART
|
||||
sa.sa_flags = SA_RESTART;
|
||||
#endif
|
||||
sa.sa_handler = exit_program;
|
||||
sigaction(SIGINT, &sa, NULL); // Ctrl-C
|
||||
sigaction(SIGTERM, &sa, NULL); // "regular" kill
|
||||
|
||||
@@ -174,6 +174,7 @@ AC_CHECK_HEADERS([sys/sysctl.h], [], [],
|
||||
]])
|
||||
|
||||
dnl Check for particular preprocessor macros
|
||||
LCD_SA_RESTART
|
||||
|
||||
dnl Checks for typedefs, structures, and compiler characteristics.
|
||||
AC_C_CONST
|
||||
|
||||
@@ -559,7 +559,9 @@ install_signal_handlers(int allow_reload)
|
||||
sigaction(SIGPIPE, &sa, NULL);
|
||||
|
||||
sa.sa_handler = exit_program;
|
||||
#ifdef HAVE_SA_RESTART
|
||||
sa.sa_flags = SA_RESTART;
|
||||
#endif
|
||||
|
||||
sigaction(SIGINT, &sa, NULL); /* Ctrl-C will cause a clean exit...*/
|
||||
sigaction(SIGTERM, &sa, NULL); /* and "kill"...*/
|
||||
|
||||
Reference in New Issue
Block a user