Skip to content
GitLab
Menu
Why GitLab
Pricing
Contact Sales
Explore
Why GitLab
Pricing
Contact Sales
Explore
Sign in
Get free trial
Commits on Source (3)
remove unused function: -set_ctrl_c_hook()
· 4e042d5f
Gary E. Miller
authored
Mar 28, 2017
4e042d5f
Remove another unused function: sigint_handler()
· 1ec04e3e
Gary E. Miller
authored
Mar 28, 2017
1ec04e3e
Remove unused typedef ctrl_c_fn
· b7ae1ccf
Gary E. Miller
authored
Mar 28, 2017
b7ae1ccf
Hide whitespace changes
Inline
Side-by-side
include/ntp_stdlib.h
View file @
b7ae1ccf
...
...
@@ -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
View file @
b7ae1ccf
...
...
@@ -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
);
}