Skip to content
Commits on Source (3)
......@@ -42,8 +42,6 @@ extern void reopen_logfile (void);
extern void setup_logfile (const char *);
extern void errno_to_str(int, char *, size_t);
typedef void (*ctrl_c_fn)(void);
/* authkeys.c */
extern void auth_delkeys (void);
extern int auth_havekey (keyid_t);
......@@ -143,7 +141,6 @@ extern const char *refid_str (uint32_t, int);
extern bool decodenetnum (const char *, sockaddr_u *);
extern void signal_no_reset (int, void (*func)(int));
extern void set_ctrl_c_hook (ctrl_c_fn);
extern void getauthkeys (const char *);
extern void rereadkeys (void);
......
......@@ -7,9 +7,6 @@
#include "ntp_syslog.h"
#include "ntp_stdlib.h"
static ctrl_c_fn ctrl_c_hook;
static void sigint_handler(int);
# ifdef SA_RESTART
# define Z_SA_RESTART SA_RESTART
# else
......@@ -48,33 +45,3 @@ signal_no_reset(
exit(1);
}
}
/*
* POSIX implementation of set_ctrl_c_hook()
*/
static void
sigint_handler(
int signum
)
{
UNUSED_ARG(signum);
if (ctrl_c_hook != NULL)
(*ctrl_c_hook)();
}
void
set_ctrl_c_hook(
ctrl_c_fn c_hook
)
{
void (*handler)(int);
if (NULL == c_hook) {
handler = SIG_DFL;
ctrl_c_hook = NULL;
} else {
handler = &sigint_handler;
ctrl_c_hook = c_hook;
}
signal_no_reset(SIGINT, handler);
}