[Git][NTPsec/ntpsec][master] 2 commits: Boolification.
Eric S. Raymond
gitlab at mg.gitlab.com
Tue Nov 21 15:56:25 UTC 2017
Eric S. Raymond pushed to branch master at NTPsec / ntpsec
Commits:
23a95cff by Eric S. Raymond at 2017-11-21T10:47:08-05:00
Boolification.
- - - - -
98108139 by Eric S. Raymond at 2017-11-21T10:55:42-05:00
Make jjy driver use standard shutdown.
- - - - -
5 changed files:
- include/ntp_stdlib.h
- libntp/msyslog.c
- ntpd/refclock_gpsd.c
- ntpd/refclock_jjy.c
- ntpd/refclock_oncore.c
Changes:
=====================================
include/ntp_stdlib.h
=====================================
--- a/include/ntp_stdlib.h
+++ b/include/ntp_stdlib.h
@@ -34,7 +34,7 @@ extern int mvsnprintf(char *, size_t, const char *, va_list)
NTP_PRINTF(3, 0);
extern void msyslog(int, const char *, ...) NTP_PRINTF(2, 3);
extern void init_logging (const char *, uint32_t, int);
-extern int change_logfile (const char *, int);
+extern int change_logfile (const char *, bool);
extern void reopen_logfile (void);
extern void setup_logfile (const char *);
=====================================
libntp/msyslog.c
=====================================
--- a/libntp/msyslog.c
+++ b/libntp/msyslog.c
@@ -395,7 +395,7 @@ init_logging(
int
change_logfile(
const char * fname,
- int leave_crumbs
+ bool leave_crumbs
)
{
FILE * new_file;
=====================================
ntpd/refclock_gpsd.c
=====================================
--- a/ntpd/refclock_gpsd.c
+++ b/ntpd/refclock_gpsd.c
@@ -620,7 +620,7 @@ gpsd_shutdown(
}
pp->unitptr = NULL;
LOGIF(CLOCKINFO,
- (LOG_NOTICE, "%s: shutdown: gpsd_json(%d)", pp->refclkunit));
+ (LOG_NOTICE, "%s: shutdown: gpsd_json(%d)", (int)pp->refclkunit));
}
/* ------------------------------------------------------------------ */
=====================================
ntpd/refclock_jjy.c
=====================================
--- a/ntpd/refclock_jjy.c
+++ b/ntpd/refclock_jjy.c
@@ -223,8 +223,6 @@ struct jjyunit {
* |-- jjy_start_seiko_tsys_tdc_300
* |-- jjy_start_telephone
*
- * jjy_shutdown
- *
* jjy_poll
* |-- jjy_poll_tristate_jjy01
* |-- jjy_poll_cdex_jst2000
@@ -287,8 +285,6 @@ static int jjy_start_tristate_gpsclock01 (int, struct peer *, struct jjyunit *)
static int jjy_start_seiko_tsys_tdc_300 (int, struct peer *, struct jjyunit *);
static bool jjy_start_telephone (int, struct peer *, struct jjyunit *);
-static void jjy_shutdown (int, struct peer *);
-
static void jjy_poll (int, struct peer *);
static void jjy_poll_tristate_jjy01 (int, struct peer *);
static void jjy_poll_cdex_jst2000 (int, struct peer *);
@@ -332,7 +328,7 @@ static void printableString ( char*, int, const char*, int ) ;
struct refclock refclock_jjy = {
NAME, /* basename of driver */
jjy_start, /* start up driver */
- jjy_shutdown, /* shutdown driver */
+ NULL, /* shutdown driver in standard way */
jjy_poll, /* transmit poll message */
NULL, /* control - not used */
NULL, /* init - not used */
@@ -529,33 +525,6 @@ jjy_start ( int unit, struct peer *peer )
}
/**************************************************************************************************/
-/* jjy_shutdown - shutdown the clock */
-/**************************************************************************************************/
-static void
-jjy_shutdown ( int unit, struct peer *peer )
-{
-
- struct jjyunit *up;
- struct refclockproc *pp;
-
- char sLog [ MAX_LOGTEXT ] ;
-
- pp = peer->procptr ;
- up = pp->unitptr ;
- if ( -1 != pp->io.fd ) {
- io_closeclock ( &pp->io ) ;
- }
- if ( NULL != up ) {
- free ( up ) ;
- }
-
- snprintf(sLog, sizeof(sLog), "JJY stopped. unit=%d subtype=%u",
- unit, peer->cfg.ttl);
- record_clock_stats(peer, sLog ) ;
-
-}
-
-/**************************************************************************************************/
/* jjy_receive - receive data from the serial interface */
/**************************************************************************************************/
static void
=====================================
ntpd/refclock_oncore.c
=====================================
--- a/ntpd/refclock_oncore.c
+++ b/ntpd/refclock_oncore.c
@@ -801,6 +801,8 @@ oncore_poll(
{
struct instance *instance;
+ UNUSED_ARG(unit);
+
instance = peer->procptr->unitptr;
if (instance->timeout) {
instance->timeout--;
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/compare/483d2667b8c3bebd039d230a1c1ba9dcbc8d1cb4...98108139521cb1b3e0d5e30610ea0be93995b566
---
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/compare/483d2667b8c3bebd039d230a1c1ba9dcbc8d1cb4...98108139521cb1b3e0d5e30610ea0be93995b566
You're receiving this email because of your account on gitlab.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20171121/62434cfc/attachment.html>
More information about the vc
mailing list