summaryrefslogtreecommitdiff
path: root/src/signal
diff options
context:
space:
mode:
authorJakob Kaivo <jkk@ung.org>2024-01-31 00:00:51 -0500
committerJakob Kaivo <jkk@ung.org>2024-01-31 00:00:51 -0500
commit36bd6c283383851664bbe598601c99385e5dcd43 (patch)
tree841682120f19b993eb6de1e6a0c30dda6a11aabf /src/signal
parentf10737a4ee4a818acdc28fa2e32c85a74f47eb5c (diff)
make tweaks to work with 1:1 checked functions
Diffstat (limited to 'src/signal')
-rw-r--r--src/signal/__signal.c2
-rw-r--r--src/signal/__signal_handler.c8
-rw-r--r--src/signal/_signal.h2
-rw-r--r--src/signal/signal.c8
4 files changed, 10 insertions, 10 deletions
diff --git a/src/signal/__signal.c b/src/signal/__signal.c
index e8c37e58..d4a819c6 100644
--- a/src/signal/__signal.c
+++ b/src/signal/__signal.c
@@ -1,6 +1,6 @@
#include "_signal.h"
-struct __signal __signal = {0};
+struct __signal ___signal = {0};
/*
STDC(0)
diff --git a/src/signal/__signal_handler.c b/src/signal/__signal_handler.c
index 985fa393..ca529999 100644
--- a/src/signal/__signal_handler.c
+++ b/src/signal/__signal_handler.c
@@ -4,12 +4,12 @@
void __signal_handler(int sig)
{
- __signal.current = sig;
- if (__signal.handlers[sig] != NULL) {
- __signal.handlers[sig](sig);
+ ___signal.current = sig;
+ if (___signal.handlers[sig] != NULL) {
+ ___signal.handlers[sig](sig);
}
/* TODO: if signal is fatal, trigger UB */
- __signal.current = 0;
+ ___signal.current = 0;
}
/*
diff --git a/src/signal/_signal.h b/src/signal/_signal.h
index 63490b2c..40a01fa0 100644
--- a/src/signal/_signal.h
+++ b/src/signal/_signal.h
@@ -10,7 +10,7 @@ typedef void (*handler)(int);
extern struct __signal {
int current;
handler handlers[NSIGNALS];
-} __signal;
+} ___signal;
void __signal_handler(int);
diff --git a/src/signal/signal.c b/src/signal/signal.c
index 07fb5ce0..4172c6da 100644
--- a/src/signal/signal.c
+++ b/src/signal/signal.c
@@ -22,7 +22,7 @@
void (*signal(int sig, void (*func)(int)))(int)
{
/* signal safe iff we are resetting the current signal handler */
- SIGNAL_SAFE((__signal.current == sig));
+ SIGNAL_SAFE((___signal.current == sig));
if (sig < 0 || sig > NSIGNALS) {
/* FIXME: should errno be set? */
@@ -31,8 +31,8 @@ void (*signal(int sig, void (*func)(int)))(int)
/* TODO: install __signal_handler as a hook */
- void (*prev)(int) = __signal.handlers[sig];
- __signal.handlers[sig] = func;
+ void (*prev)(int) = ___signal.handlers[sig];
+ ___signal.handlers[sig] = func;
struct linux_sigaction act = { 0 };
act.sa_handler = __signal_handler;
@@ -48,7 +48,7 @@ void (*signal(int sig, void (*func)(int)))(int)
}
typedef void (*handler)(int);
-//__check_2(handler, SIG_ERR, signal, int, handler)
+CHECK_2(handler, SIG_ERR, signal, int, handler)
/***
sets the signal handler for the signal specified by ARGUMENT(sig) to