From: Tim Kientzle Date: Sat, 12 Dec 2009 20:56:08 +0000 (-0500) Subject: Explicitly test for sigaction() rather than X-Git-Tag: v2.8.0~98 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b5bae8ca335f9c593390838008dc59d057873b97;p=thirdparty%2Flibarchive.git Explicitly test for sigaction() rather than treating the existence of SIGINFO and SIGUSR1 as sufficient evidence of sigaction() support. SVN-Revision: 1726 --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 92d65f72b..8cc6dbede 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -394,6 +394,7 @@ CHECK_FUNCTION_EXISTS_GLIBC(readlink HAVE_READLINK) CHECK_FUNCTION_EXISTS_GLIBC(select HAVE_SELECT) CHECK_FUNCTION_EXISTS_GLIBC(setenv HAVE_SETENV) CHECK_FUNCTION_EXISTS_GLIBC(setlocale HAVE_SETLOCALE) +CHECK_FUNCTION_EXISTS_GLIBC(sigaction HAVE_SIGACTION) CHECK_FUNCTION_EXISTS_GLIBC(strchr HAVE_STRCHR) CHECK_FUNCTION_EXISTS_GLIBC(strdup HAVE_STRDUP) CHECK_FUNCTION_EXISTS_GLIBC(strerror HAVE_STRERROR) diff --git a/configure.ac b/configure.ac index f58473fd6..fb624a865 100644 --- a/configure.ac +++ b/configure.ac @@ -303,9 +303,12 @@ if test "x$with_openssl" != "xno"; then # the C code tests these macros we preserve previous behavior # for the autotools build by hard-coding availability. if test "$ac_cv_header_openssl_sha_h" = "yes"; then - AC_DEFINE(HAVE_OPENSSL_SHA256_INIT, 1, [Define to 1 if your openssl has the `SHA256_Init' function.]) - AC_DEFINE(HAVE_OPENSSL_SHA384_INIT, 1, [Define to 1 if your openssl has the `SHA384_Init' function.]) - AC_DEFINE(HAVE_OPENSSL_SHA512_INIT, 1, [Define to 1 if your openssl has the `SHA512_Init' function.]) + AC_DEFINE(HAVE_OPENSSL_SHA256_INIT, 1, + [Define to 1 if your openssl has the `SHA256_Init' function.]) + AC_DEFINE(HAVE_OPENSSL_SHA384_INIT, 1, + [Define to 1 if your openssl has the `SHA384_Init' function.]) + AC_DEFINE(HAVE_OPENSSL_SHA512_INIT, 1, + [Define to 1 if your openssl has the `SHA512_Init' function.]) fi fi fi @@ -395,7 +398,8 @@ AC_CHECK_FUNCS([fchdir fchflags fchmod fchown fcntl fork]) AC_CHECK_FUNCS([fstat ftruncate futimens futimes geteuid getpid]) AC_CHECK_FUNCS([lchflags lchmod lchown link lstat]) AC_CHECK_FUNCS([lutimes memmove memset mkdir mkfifo mknod]) -AC_CHECK_FUNCS([nl_langinfo pipe poll readlink select setenv setlocale]) +AC_CHECK_FUNCS([nl_langinfo pipe poll readlink]) +AC_CHECK_FUNCS([select setenv setlocale sigaction]) AC_CHECK_FUNCS([strchr strdup strerror strncpy_s strrchr symlink timegm]) AC_CHECK_FUNCS([tzset unsetenv utime utimensat utimes vfork]) AC_CHECK_FUNCS([wcrtomb wcscpy wcslen wctomb wmemcmp wmemcpy]) diff --git a/tar/bsdtar.c b/tar/bsdtar.c index 69804b81d..9c5cf5b3c 100644 --- a/tar/bsdtar.c +++ b/tar/bsdtar.c @@ -87,7 +87,7 @@ __FBSDID("$FreeBSD: src/usr.bin/tar/bsdtar.c,v 1.93 2008/11/08 04:43:24 kientzle static struct bsdtar *_bsdtar; -#if defined(SIGINFO) || defined(SIGUSR1) +#if defined(HAVE_SIGACTION) && (defined(SIGINFO) || defined(SIGUSR1)) static volatile int siginfo_occurred; static void @@ -145,7 +145,7 @@ main(int argc, char **argv) bsdtar->fd = -1; /* Mark as "unused" */ option_o = 0; -#if defined(SIGINFO) || defined(SIGUSR1) +#if defined(HAVE_SIGACTION) && (defined(SIGINFO) || defined(SIGUSR1)) { /* Catch SIGINFO and SIGUSR1, if they exist. */ struct sigaction sa; sa.sa_handler = siginfo_handler;