From: Frank Kardel Date: Fri, 26 May 2006 14:40:03 +0000 (+0000) Subject: refclock_parse.c: X-Git-Tag: NTP_4_2_1P256_RC~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=12b83c5d8b24a001ecc7a76aefafc5210f5b95a4;p=thirdparty%2Fntp.git refclock_parse.c: bug 619 delay io_addclock() even further as suggested by Ronan Flood bk: 44771343KbWPgvlyWRM6T2lLqOr92A --- diff --git a/ntpd/refclock_parse.c b/ntpd/refclock_parse.c index ab541e006..1ba6685e7 100644 --- a/ntpd/refclock_parse.c +++ b/ntpd/refclock_parse.c @@ -1,7 +1,7 @@ /* - * /src/NTP/REPOSITORY/ntp4-dev/ntpd/refclock_parse.c,v 4.70 2006/05/25 18:20:50 kardel RELEASE_20060525_C + * /src/NTP/REPOSITORY/ntp4-dev/ntpd/refclock_parse.c,v 4.73 2006/05/26 14:23:46 kardel RELEASE_20060526_A * - * refclock_parse.c,v 4.70 2006/05/25 18:20:50 kardel RELEASE_20060525_C + * refclock_parse.c,v 4.73 2006/05/26 14:23:46 kardel RELEASE_20060526_A * * generic reference clock driver for several DCF/GPS/MSF/... receivers * @@ -182,7 +182,7 @@ #include "ieee754io.h" #include "recvbuff.h" -static char rcsid[] = "refclock_parse.c,v 4.70 2006/05/25 18:20:50 kardel RELEASE_20060525_C"; +static char rcsid[] = "refclock_parse.c,v 4.73 2006/05/26 14:23:46 kardel RELEASE_20060526_A"; /**=========================================================================== ** external interface to ntp mechanism @@ -2776,7 +2776,7 @@ parse_start( if (!notice) { NLOG(NLOG_CLOCKINFO) /* conditional if clause for conditional syslog */ - msyslog(LOG_INFO, "NTP PARSE support: Copyright (c) 1989-2005, Frank Kardel"); + msyslog(LOG_INFO, "NTP PARSE support: Copyright (c) 1989-2006, Frank Kardel"); notice = 1; } @@ -3011,17 +3011,6 @@ parse_start( parse->generic->io.clock_recv = parse->binding->bd_receive; /* pick correct receive routine */ parse->generic->io.io_input = parse->binding->bd_io_input; /* pick correct input routine */ - /* - * Insert in async io device list. - */ - if (!io_addclock(&parse->generic->io)) - { - msyslog(LOG_ERR, - "PARSE receiver #%d: parse_start: addclock %s fails (ABORT - clock type requires async io)", CLK_UNIT(parse->peer), parsedev); - parse_shutdown(CLK_UNIT(parse->peer), peer); /* let our cleaning staff do the work */ - return 0; - } - /* * as we always(?) get 8 bit chars we want to be * sure, that the upper bits are zero for less @@ -3072,11 +3061,8 @@ parse_start( #ifdef HAVE_TERMIOS (void) tcflush(parse->generic->io.fd, TCIOFLUSH); #else -#ifdef TCFLSH +#if defined(TCFLSH) && defined(TCIOFLUSH) { -#ifndef TCIOFLUSH -#define TCIOFLUSH 2 -#endif int flshcmd = TCIOFLUSH; (void) ioctl(parse->generic->io.fd, TCFLSH, (caddr_t)&flshcmd); @@ -3096,6 +3082,17 @@ parse_start( } } + /* + * Insert in async io device list. + */ + if (!io_addclock(&parse->generic->io)) + { + msyslog(LOG_ERR, + "PARSE receiver #%d: parse_start: addclock %s fails (ABORT - clock type requires async io)", CLK_UNIT(parse->peer), parsedev); + parse_shutdown(CLK_UNIT(parse->peer), peer); /* let our cleaning staff do the work */ + return 0; + } + /* * print out configuration */ @@ -5681,6 +5678,15 @@ int refclock_parse_bs; * History: * * refclock_parse.c,v + * Revision 4.73 2006/05/26 14:23:46 kardel + * cleanup of copyright info + * + * Revision 4.72 2006/05/26 14:19:43 kardel + * cleanup of ioctl cruft + * + * Revision 4.71 2006/05/26 14:15:57 kardel + * delay adding refclock to async refclock io after all initializations + * * Revision 4.70 2006/05/25 18:20:50 kardel * bug #619 * terminate parse io engine after de-registering