open-isns: fix compilation without deprecated signal API
authorRosen Penev <rosenp@gmail.com>
Fri, 14 Aug 2020 03:13:44 +0000 (20:13 -0700)
committerRosen Penev <rosenp@gmail.com>
Fri, 14 Aug 2020 04:35:05 +0000 (21:35 -0700)
Upstream backport.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
net/open-isns/Makefile
net/open-isns/patches/20-signals.patch [new file with mode: 0644]

index 12df1260ad0c253c66600c192d306bb2314e1e3f..f2a0991e5ab38343f4e87b35f2102bbaf0ea603b 100644 (file)
@@ -5,7 +5,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=open-isns
 PKG_VERSION:=0.100
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://codeload.github.com/open-iscsi/open-isns/tar.gz/v$(PKG_VERSION)?
diff --git a/net/open-isns/patches/20-signals.patch b/net/open-isns/patches/20-signals.patch
new file mode 100644 (file)
index 0000000..8982847
--- /dev/null
@@ -0,0 +1,41 @@
+From e7dac76ce61039fefa58985c955afccb60dabe87 Mon Sep 17 00:00:00 2001
+From: Rosen Penev <rosenp@gmail.com>
+Date: Wed, 29 Apr 2020 15:55:55 -0700
+Subject: [PATCH] libisns: remove sighold and sigrelse
+
+The man page says that these are deprecated. Use sugprocmask as a replacement.
+---
+ include/libisns/util.h | 16 ++++++++++++----
+ 1 file changed, 12 insertions(+), 4 deletions(-)
+
+diff --git a/include/libisns/util.h b/include/libisns/util.h
+index e5ed037..f1b97f0 100644
+--- a/include/libisns/util.h
++++ b/include/libisns/util.h
+@@ -41,14 +41,22 @@ char *             print_size(unsigned long);
+  */
+ static inline void signals_hold(void)
+ {
+-      sighold(SIGTERM);
+-      sighold(SIGINT);
++      sigset_t s;
++
++      sigemptyset(&s);
++      sigaddset(&s, SIGTERM);
++      sigaddset(&s, SIGINT);
++      sigprocmask(SIG_BLOCK, &s, 0);
+ }
+ static inline void signals_release(void)
+ {
+-      sigrelse(SIGTERM);
+-      sigrelse(SIGINT);
++      sigset_t s;
++
++      sigemptyset(&s);
++      sigaddset(&s, SIGTERM);
++      sigaddset(&s, SIGINT);
++      sigprocmask(SIG_UNBLOCK, &s, 0);
+ }
+ /*