From: Juergen Perlinger Date: Thu, 20 Feb 2014 20:22:08 +0000 (+0100) Subject: refclock_gpsdjson: operation reordering (grouping) during startup X-Git-Tag: NTP_4_2_7P427~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0718eb59664723c43098ed2af6091273101c1603;p=thirdparty%2Fntp.git refclock_gpsdjson: operation reordering (grouping) during startup bk: 530663f0mUEUwVom7Je8YIfZb3qE8w --- diff --git a/ntpd/refclock_gpsdjson.c b/ntpd/refclock_gpsdjson.c index 279861ca0..834cf53e4 100644 --- a/ntpd/refclock_gpsdjson.c +++ b/ntpd/refclock_gpsdjson.c @@ -217,23 +217,25 @@ gpsd_start( struct stat sb; + /* initialize the unit structure */ up->fdt = -1; up->addr = s_gpsd_addr; up->last_event = CEVNT_NOMINAL; up->next_event = CEVNT_TIMEOUT; - /* connect &initialize the unit structure */ + /* setup refclock processing */ pp->unitptr = (caddr_t)up; pp->io.fd = -1; pp->io.clock_recv = gpsd_receive; pp->io.srcclock = peer; pp->io.datalen = 0; pp->a_lastcode[0] = '\0'; + pp->lencode = 0; + pp->clockdesc = DESCRIPTION; + memcpy(&pp->refid, REFID, 4); /* Initialize miscellaneous variables */ peer->precision = PRECISION; - pp->clockdesc = DESCRIPTION; - memcpy(&pp->refid, REFID, 4); /* Create the device name and check for a Character Device. It's * assumed that GPSD was started with the same link, so the