isns-utils/0007-libisns-remove-sighold-and-sigrelse.patch
Petr Šabata 2f4ce7d441 RHEL 9.0.0 Alpha bootstrap
The content of this branch was automatically imported from Fedora ELN
with the following as its source:
https://src.fedoraproject.org/rpms/isns-utils#3f3376053060f373cf3ad72a2e3bf913e8c0c61a
2020-10-15 13:48:09 +02:00

45 lines
1.0 KiB
Diff

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 7/7] 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);
}
/*
--
2.18.1