2
0
mirror of https://github.com/sudo-project/sudo.git synced 2025-08-22 18:08:23 +00:00

Add configure test for NSIG, _NSIG or __NSIG.

This is better than just defining NSIG in sudo_compat.h if it is
not defined since signal.h may not have been included.
This commit is contained in:
Todd C. Miller 2023-01-31 11:30:45 -07:00
parent 49df977c2f
commit ffb09be49d
4 changed files with 93 additions and 4 deletions

View File

@ -155,6 +155,10 @@
don't. */
#undef HAVE_DECL_LLONG_MIN
/* Define to 1 if you have the declaration of 'NSIG', and to 0 if you don't.
*/
#undef HAVE_DECL_NSIG
/* Define to 1 if you have the declaration of 'PATH_MAX', and to 0 if you
don't. */
#undef HAVE_DECL_PATH_MAX
@ -231,6 +235,10 @@
don't. */
#undef HAVE_DECL__INNETGR
/* Define to 1 if you have the declaration of '_NSIG', and to 0 if you don't.
*/
#undef HAVE_DECL__NSIG
/* Define to 1 if you have the declaration of '_POSIX_PATH_MAX', and to 0 if
you don't. */
#undef HAVE_DECL__POSIX_PATH_MAX
@ -243,6 +251,10 @@
don't. */
#undef HAVE_DECL__SYS_SIGNAME
/* Define to 1 if you have the declaration of '__NSIG', and to 0 if you don't.
*/
#undef HAVE_DECL___NSIG
/* Define to 1 if you have the 'devname' function. */
#undef HAVE_DEVNAME

59
configure vendored
View File

@ -27654,6 +27654,65 @@ case "$enable_zlib" in
;;
esac
ac_fn_check_decl "$LINENO" "NSIG" "ac_cv_have_decl_NSIG" "
$ac_includes_default
#include <signal.h>
" "$ac_c_undeclared_builtin_options" "CFLAGS"
if test "x$ac_cv_have_decl_NSIG" = xyes
then :
ac_have_decl=1
else case e in #(
e) ac_have_decl=0 ;;
esac
fi
printf "%s\n" "#define HAVE_DECL_NSIG $ac_have_decl" >>confdefs.h
if test $ac_have_decl = 1
then :
else case e in #(
e)
ac_fn_check_decl "$LINENO" "_NSIG" "ac_cv_have_decl__NSIG" "
$ac_includes_default
#include <signal.h>
" "$ac_c_undeclared_builtin_options" "CFLAGS"
if test "x$ac_cv_have_decl__NSIG" = xyes
then :
ac_have_decl=1
else case e in #(
e) ac_have_decl=0 ;;
esac
fi
printf "%s\n" "#define HAVE_DECL__NSIG $ac_have_decl" >>confdefs.h
if test $ac_have_decl = 1
then :
else case e in #(
e)
ac_fn_check_decl "$LINENO" "__NSIG" "ac_cv_have_decl___NSIG" "
$ac_includes_default
#include <signal.h>
" "$ac_c_undeclared_builtin_options" "CFLAGS"
if test "x$ac_cv_have_decl___NSIG" = xyes
then :
ac_have_decl=1
else case e in #(
e) ac_have_decl=0 ;;
esac
fi
printf "%s\n" "#define HAVE_DECL___NSIG $ac_have_decl" >>confdefs.h
;;
esac
fi
;;
esac
fi
ac_fn_check_decl "$LINENO" "errno" "ac_cv_have_decl_errno" "
$ac_includes_default
#include <errno.h>

View File

@ -3282,6 +3282,24 @@ case "$enable_zlib" in
;;
esac
dnl
dnl Check for NSIG, _NSIG or __NSIG declarations in signal.h
dnl
AC_CHECK_DECLS([NSIG], [], [
AC_CHECK_DECLS([_NSIG], [], [
AC_CHECK_DECLS([__NSIG], [], [], [
AC_INCLUDES_DEFAULT
#include <signal.h>
])
], [
AC_INCLUDES_DEFAULT
#include <signal.h>
])
], [
AC_INCLUDES_DEFAULT
#include <signal.h>
])
dnl
dnl Check for errno declaration in errno.h
dnl

View File

@ -1,7 +1,7 @@
/*
* SPDX-License-Identifier: ISC
*
* Copyright (c) 1996, 1998-2005, 2008, 2009-2022
* Copyright (c) 1996, 1998-2005, 2008, 2009-2023
* Todd C. Miller <Todd.Miller@sudo.ws>
*
* Permission to use, copy, modify, and distribute this software for any
@ -205,10 +205,10 @@ extern int errno;
#endif /* !HAVE_DECL_ERRNO */
/* Not all systems define NSIG in signal.h */
#if !defined(NSIG)
# if defined(_NSIG)
#if !defined(HAVE_DECL_NSIG) || !HAVE_DECL_NSIG
# if defined(HAVE_DECL__NSIG) && HAVE_DECL__NSIG
# define NSIG _NSIG
# elif defined(__NSIG)
# elif defined(HAVE_DECL___NSIG) && HAVE_DECL___NSIG
# define NSIG __NSIG
# else
# define NSIG 64