summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJannis Hoffmann <jannis@fehcom.de>2024-07-14 18:01:52 +0200
committerJannis Hoffmann <jannis@fehcom.de>2024-07-14 18:01:52 +0200
commitf9a8fff2f90626aadd915178d04ece49d8c4884a (patch)
tree3e38a583fdb261b52d7bbf4964e5662c36c1971e
parent25708a111e0127aa86611f8a513cb67ae70b2123 (diff)
switch to signal handlers that take no arguments for concrete signals
-rw-r--r--include/sig.h22
-rw-r--r--src/sig.c16
2 files changed, 20 insertions, 18 deletions
diff --git a/include/sig.h b/include/sig.h
index bd3efc5..2c44e9a 100644
--- a/include/sig.h
+++ b/include/sig.h
@@ -2,11 +2,13 @@
#define SIG_H
/*
- * Revision 20160714, Kai Peter
- * - updated some declarations no new(er) one's from ucspi-tcp-0.88
-*/
+ * Revision 20160714, Kai Peter
+ * - updated some declarations no new(er) one's from ucspi-tcp-0.88
+ * Revision 20240714, JMH
+ * - added best effort parameter types
+ */
-/* new(er) declarations from ucspi-tcp-0.88: */
+// new(er) declarations from ucspi-tcp-0.88:
extern int sig_alarm;
extern int sig_child;
extern int sig_cont;
@@ -28,7 +30,7 @@ extern void sig_pause(void);
extern void sig_dfl(int);
-/* declaration of (net)qmail package (untouched) */
+// declaration of (net)qmail package
extern void sig_miscignore(void);
extern void sig_bugcatch(void (*)(int));
@@ -37,27 +39,27 @@ extern void sig_pipedefault(void);
extern void sig_contblock(void);
extern void sig_contunblock(void);
-extern void sig_contcatch(void (*)(int));
+extern void sig_contcatch(void (*)(void));
extern void sig_contdefault(void);
extern void sig_termblock(void);
extern void sig_termunblock(void);
-extern void sig_termcatch(void (*)(int));
+extern void sig_termcatch(void (*)(void));
extern void sig_termdefault(void);
extern void sig_alarmblock(void);
extern void sig_alarmunblock(void);
-extern void sig_alarmcatch(void (*)(int));
+extern void sig_alarmcatch(void (*)(void));
extern void sig_alarmdefault(void);
extern void sig_childblock(void);
extern void sig_childunblock(void);
-extern void sig_childcatch(void (*)(int));
+extern void sig_childcatch(void (*)(void));
extern void sig_childdefault(void);
extern void sig_hangupblock(void);
extern void sig_hangupunblock(void);
-extern void sig_hangupcatch(void (*)(int));
+extern void sig_hangupcatch(void (*)(void));
extern void sig_hangupdefault(void);
#endif
diff --git a/src/sig.c b/src/sig.c
index 4c88143..e7c312e 100644
--- a/src/sig.c
+++ b/src/sig.c
@@ -19,9 +19,9 @@ void sig_alarmunblock()
sig_unblock(SIGALRM);
}
-void sig_alarmcatch(void (*f)(int))
+void sig_alarmcatch(void (*f)(void))
{
- sig_catch(SIGALRM, f);
+ sig_catch(SIGALRM, (void (*)(int))f);
}
void sig_alarmdefault()
@@ -92,9 +92,9 @@ void sig_childunblock()
sig_unblock(SIGCHLD);
}
-void sig_childcatch(void (*f)(int))
+void sig_childcatch(void (*f)(void))
{
- sig_catch(SIGCHLD, f);
+ sig_catch(SIGCHLD, (void (*)(int))f);
}
void sig_childdefault()
@@ -114,9 +114,9 @@ void sig_hangupunblock()
sig_unblock(SIGHUP);
}
-void sig_hangupcatch(void (*f)(int))
+void sig_hangupcatch(void (*f)(void))
{
- sig_catch(SIGHUP, f);
+ sig_catch(SIGHUP, (void (*)(int))f);
}
void sig_hangupdefault()
@@ -136,9 +136,9 @@ void sig_termunblock()
sig_unblock(SIGTERM);
}
-void sig_termcatch(f) void (*f)(int);
+void sig_termcatch(void (*f)(void))
{
- sig_catch(SIGTERM, f);
+ sig_catch(SIGTERM, (void (*)(int))f);
}
void sig_termdefault()