From ab5d33ed80bb0ceb7de001317e5e8e5d57a3a0e44f29b23126119f3727b99974 Mon Sep 17 00:00:00 2001 From: Marcus Meissner Date: Thu, 3 Sep 2020 15:33:41 +0000 Subject: [PATCH] Accepting request 831286 from home:gmbr3:Active - Add use-signal-function-instead-of-sigignore.patch: sigignore causes deprecation errors(gh#memcached/memcached#691) OBS-URL: https://build.opensuse.org/request/show/831286 OBS-URL: https://build.opensuse.org/package/show/network:utilities/memcached?expand=0&rev=78 --- memcached.changes | 6 ++ memcached.spec | 3 + ...signal-function-instead-of-sigignore.patch | 85 +++++++++++++++++++ 3 files changed, 94 insertions(+) create mode 100644 use-signal-function-instead-of-sigignore.patch diff --git a/memcached.changes b/memcached.changes index d3e39cb..490efac 100644 --- a/memcached.changes +++ b/memcached.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Tue Sep 1 19:24:14 UTC 2020 - Callum Farmer + +- Add use-signal-function-instead-of-sigignore.patch: sigignore + causes deprecation errors(gh#memcached/memcached#691) + ------------------------------------------------------------------- Sat Jun 6 05:37:41 UTC 2020 - Andreas Stieger diff --git a/memcached.spec b/memcached.spec index 3a113af..557c079 100644 --- a/memcached.spec +++ b/memcached.spec @@ -39,6 +39,8 @@ Source1: %{name}.init Source2: %{name}.sysconfig Source3: memcached-rpmlintrc Source4: memcached.service +# PATCH-FIX-UPSTREAM gh#memcached/memcached#691 +Patch: use-signal-function-instead-of-sigignore.patch BuildRequires: autoconf BuildRequires: automake BuildRequires: cyrus-sasl-devel @@ -88,6 +90,7 @@ This package contains development files %prep %setup -q +%patch -p1 %build autoreconf -fi diff --git a/use-signal-function-instead-of-sigignore.patch b/use-signal-function-instead-of-sigignore.patch new file mode 100644 index 0000000..d8d5378 --- /dev/null +++ b/use-signal-function-instead-of-sigignore.patch @@ -0,0 +1,85 @@ +From c6821a866e50754181bcf14533e3d4c31be36b79 Mon Sep 17 00:00:00 2001 +From: Tomas Korbar +Date: Mon, 29 Jun 2020 08:56:09 +0200 +Subject: [PATCH] Use signal function instead of sigignore + +Sigignore has been marked as deprecated on Fedora rawhide and +signal function is used already on multiple places in memcached.c + +fix #690 +--- + configure.ac | 5 ++--- + memcached.c | 16 ++-------------- + 2 files changed, 4 insertions(+), 17 deletions(-) + +diff --git a/configure.ac b/configure.ac +index ffc98b24e..a7be211e0 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -630,7 +630,6 @@ AC_CHECK_FUNCS(mlockall) + AC_CHECK_FUNCS(getpagesizes) + AC_CHECK_FUNCS(sysconf) + AC_CHECK_FUNCS(memcntl) +-AC_CHECK_FUNCS(sigignore) + AC_CHECK_FUNCS(clock_gettime) + AC_CHECK_FUNCS(preadv) + AC_CHECK_FUNCS(pread) +@@ -779,7 +778,7 @@ if test "$ICC" = "yes" + then + dnl ICC trying to be gcc. + CFLAGS="$CFLAGS -diag-disable 187 -Wall -Werror" +- AC_DEFINE([_GNU_SOURCE],[1],[find sigignore on Linux]) ++ AC_DEFINE([_GNU_SOURCE],[1],[make sure IOV_MAX is defined]) + elif test "$GCC" = "yes" + then + GCC_VERSION=`$CC -dumpversion` +@@ -792,7 +791,7 @@ then + CFLAGS="$CFLAGS -fno-strict-aliasing" + ;; + esac +- AC_DEFINE([_GNU_SOURCE],[1],[find sigignore on Linux]) ++ AC_DEFINE([_GNU_SOURCE],[1],[make sure IOV_MAX is defined]) + elif test "$SUNCC" = "yes" + then + CFLAGS="$CFLAGS -errfmt=error -errwarn -errshort=tags" +diff --git a/memcached.c b/memcached.c +index d796abb4b..dc67267c4 100644 +--- a/memcached.c ++++ b/memcached.c +@@ -8400,18 +8400,6 @@ static void sig_usrhandler(const int sig) { + stop_main_loop = GRACE_STOP; + } + +-#ifndef HAVE_SIGIGNORE +-static int sigignore(int sig) { +- struct sigaction sa = { .sa_handler = SIG_IGN, .sa_flags = 0 }; +- +- if (sigemptyset(&sa.sa_mask) == -1 || sigaction(sig, &sa, 0) == -1) { +- return -1; +- } +- return 0; +-} +-#endif +- +- + /* + * On systems that supports multiple page sizes we may reduce the + * number of TLB-misses by using the biggest available page size +@@ -10097,7 +10085,7 @@ int main (int argc, char **argv) { + /* daemonize if requested */ + /* if we want to ensure our ability to dump core, don't chdir to / */ + if (do_daemonize) { +- if (sigignore(SIGHUP) == -1) { ++ if (signal(SIGHUP, SIG_IGN) == SIG_ERR) { + perror("Failed to ignore SIGHUP"); + } + if (daemonize(maxcore, settings.verbose) == -1) { +@@ -10247,7 +10235,7 @@ int main (int argc, char **argv) { + * ignore SIGPIPE signals; we can use errno == EPIPE if we + * need that information + */ +- if (sigignore(SIGPIPE) == -1) { ++ if (signal(SIGPIPE, SIG_IGN) == SIG_ERR) { + perror("failed to ignore SIGPIPE; sigaction"); + exit(EX_OSERR); + }