[Git][NTPsec/ntpsec][master] 3 commits: remove unused function: -set_ctrl_c_hook()
Gary E. Miller
gitlab at mg.gitlab.com
Tue Mar 28 22:46:04 UTC 2017
Gary E. Miller pushed to branch master at NTPsec / ntpsec
Commits:
4e042d5f by Gary E. Miller at 2017-03-28T15:40:47-07:00
remove unused function: -set_ctrl_c_hook()
- - - - -
1ec04e3e by Gary E. Miller at 2017-03-28T15:43:51-07:00
Remove another unused function: sigint_handler()
- - - - -
b7ae1ccf by Gary E. Miller at 2017-03-28T15:45:29-07:00
Remove unused typedef ctrl_c_fn
- - - - -
2 changed files:
- include/ntp_stdlib.h
- libntp/syssignal.c
Changes:
=====================================
include/ntp_stdlib.h
=====================================
--- a/include/ntp_stdlib.h
+++ b/include/ntp_stdlib.h
@@ -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);
=====================================
libntp/syssignal.c
=====================================
--- a/libntp/syssignal.c
+++ b/libntp/syssignal.c
@@ -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);
-}
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/compare/2c5714b633a12244ae638c9ed9e9417a41cf9d95...b7ae1ccf7dd5da1a1fd7d4726598e09cb0f0ee17
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20170328/a3f945e6/attachment.html>
More information about the vc
mailing list