aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2023-06-13 02:08:25 +0200
committerEgor Tensin <Egor.Tensin@gmail.com>2023-06-13 02:24:02 +0200
commitdc1b262760edcf6e9ea9bdd34341b5f7747dead3 (patch)
tree4c5cef4ede2081d24d49bdf9e009468949f6ef9c
parentevent_loop: hide the API details (diff)
downloadcimple-dc1b262760edcf6e9ea9bdd34341b5f7747dead3.tar.gz
cimple-dc1b262760edcf6e9ea9bdd34341b5f7747dead3.zip
signal: remove unused APIs
-rw-r--r--src/signal.c41
-rw-r--r--src/signal.h3
2 files changed, 0 insertions, 44 deletions
diff --git a/src/signal.c b/src/signal.c
index 2c80c85..d8f89bd 100644
--- a/src/signal.c
+++ b/src/signal.c
@@ -13,7 +13,6 @@
#include <signal.h>
#include <stddef.h>
-#include <string.h>
#include <sys/signalfd.h>
#include <unistd.h>
@@ -26,46 +25,6 @@ static void stops_set(sigset_t *set)
sigaddset(set, stop_signals[i]);
}
-volatile sig_atomic_t global_stop_flag = 0;
-
-static void set_global_stop_flag(UNUSED int signum)
-{
- global_stop_flag = 1;
-}
-
-static int my_sigaction(int signo, const struct sigaction *act)
-{
- int ret = 0;
-
- ret = sigaction(signo, act, NULL);
- if (ret < 0) {
- log_errno("sigaction");
- return ret;
- }
-
- return ret;
-}
-
-int signal_handle_stops(void)
-{
- int ret = 0;
-
- struct sigaction sa;
- memset(&sa, 0, sizeof(sa));
- sa.sa_handler = set_global_stop_flag;
-
- /* Don't care about proper cleanup here; we exit the program if this
- * fails anyway. */
-
- for (size_t i = 0; i < sizeof(stop_signals) / sizeof(stop_signals[0]); ++i) {
- ret = my_sigaction(stop_signals[i], &sa);
- if (ret < 0)
- return ret;
- }
-
- return ret;
-}
-
static int signal_set(const sigset_t *new, sigset_t *old)
{
int ret = 0;
diff --git a/src/signal.h b/src/signal.h
index d2b7a9c..0dda6ee 100644
--- a/src/signal.h
+++ b/src/signal.h
@@ -12,9 +12,6 @@
#include <signal.h>
-extern volatile sig_atomic_t global_stop_flag;
-int signal_handle_stops(void);
-
int signal_block_all(sigset_t *old);
int signal_block_stops(void);