From 08ce54211ce4b8d6092321ca1b28773a680ddc45 Mon Sep 17 00:00:00 2001 From: Jannis Hoffmann Date: Tue, 9 Jul 2024 16:05:46 +0200 Subject: Added missing function prototype signatures. Corrected socket_broadcast name to socket_broadcast4 in socket_if.h. Added const to fmt_str. --- src/sig.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'src/sig.c') diff --git a/src/sig.c b/src/sig.c index bf8510e..4c88143 100644 --- a/src/sig.c +++ b/src/sig.c @@ -18,7 +18,8 @@ void sig_alarmunblock() { sig_unblock(SIGALRM); } -void sig_alarmcatch(f) void (*f)(); + +void sig_alarmcatch(void (*f)(int)) { sig_catch(SIGALRM, f); } @@ -53,7 +54,7 @@ void sig_blocknone() sigprocmask(SIG_SETMASK, &ss, (sigset_t *)0); } -void sig_catch(int sig, void (*f)()) +void sig_catch(int sig, void (*f)(int)) { struct sigaction sa; sa.sa_handler = f; @@ -90,7 +91,8 @@ void sig_childunblock() { sig_unblock(SIGCHLD); } -void sig_childcatch(f) void (*f)(); + +void sig_childcatch(void (*f)(int)) { sig_catch(SIGCHLD, f); } @@ -111,7 +113,8 @@ void sig_hangupunblock() { sig_unblock(SIGHUP); } -void sig_hangupcatch(f) void (*f)(); + +void sig_hangupcatch(void (*f)(int)) { sig_catch(SIGHUP, f); } @@ -132,7 +135,8 @@ void sig_termunblock() { sig_unblock(SIGTERM); } -void sig_termcatch(f) void (*f)(); + +void sig_termcatch(f) void (*f)(int); { sig_catch(SIGTERM, f); } @@ -144,7 +148,7 @@ void sig_termdefault() int sig_term = SIGTERM; -void sig_bugcatch(void (*f)()) +void sig_bugcatch(void (*f)(int)) { sig_catch(SIGILL, f); sig_catch(SIGABRT, f); @@ -159,7 +163,7 @@ void sig_bugcatch(void (*f)()) #endif } -void (*sig_defaulthandler)() = SIG_DFL; +void (*sig_defaulthandler)(int) = SIG_DFL; void sig_miscignore() { @@ -176,6 +180,6 @@ void sig_miscignore() #endif } -void (*sig_ignorehandler)() = SIG_IGN; +void (*sig_ignorehandler)(int) = SIG_IGN; int sig_cont = SIGCONT; -- cgit v1.2.3