80
(void)sprintf(device, DEVICE, unit);
80
snprintf(device, sizeof(device), DEVICE, unit);
81
81
fd = open(device, O_RDONLY | O_NDELAY, 0777);
83
83
msyslog(LOG_ERR, "tpro_start: open of %s: %m", device);
88
88
* Allocate and initialize unit structure
90
if (!(up = (struct tprounit *) emalloc(sizeof(struct tprounit)))) {
94
memset((char *)up, 0, sizeof(struct tprounit));
90
up = emalloc(sizeof(*up));
91
memset(up, 0, sizeof(*up));
95
92
pp = peer->procptr;
96
93
pp->io.clock_recv = noentry;
97
94
pp->io.srcclock = (caddr_t)peer;
170
168
* we could pad the written string appropriately and read the
171
169
* resulting value in already scaled.
173
sprintf(pp->a_lastcode,
174
"%1x%1x%1x %1x%1x:%1x%1x:%1x%1x.%1x%1x%1x%1x%1x%1x %1x",
175
tp->day100, tp->day10, tp->day1, tp->hour10, tp->hour1,
176
tp->min10, tp->min1, tp->sec10, tp->sec1, tp->ms100,
177
tp->ms10, tp->ms1, tp->usec100, tp->usec10, tp->usec1,
179
pp->lencode = strlen(pp->a_lastcode);
171
snprintf(pp->a_lastcode, sizeof(pp->a_lastcode),
172
"%1x%1x%1x %1x%1x:%1x%1x:%1x%1x.%1x%1x%1x%1x%1x%1x %1x",
173
tp->day100, tp->day10, tp->day1, tp->hour10, tp->hour1,
174
tp->min10, tp->min1, tp->sec10, tp->sec1, tp->ms100,
175
tp->ms10, tp->ms1, tp->usec100, tp->usec10, tp->usec1,
177
pp->lencode = strlen(pp->a_lastcode);
182
180
printf("tpro: time %s timecode %d %s\n",