---
-* [Bug 1567] Support Arbiter 1093C Satellite Clock on Windows.
+* [Bug 750]: Non-existing device causes coredump with RIPE-NCC driver.
+* [Bug 1567]: Support Arbiter 1093C Satellite Clock on Windows.
* [Bug 1643]: Range-check the decoding of the RIPE-NCC status codes.
* [Bug 1644]: cvo.sh should use lsb_release to identify linux distros.
-* [Bug 1659] Support Truetime Satellite Clocks on Windows.
+* [Bug 1659]: Support Truetime Satellite Clocks on Windows.
* [Bug 1660]: On some systems, test is in /usr/bin, not /bin.
* [Bug 1661]: Re-indent refclock_ripencc.c.
struct termios tio;
TSIPPKT spt;
+ pp = peer->procptr;
+
/*
* Open serial port
*/
(void)snprintf(device, sizeof(device), DEVICE, unit);
- if (!(fd = refclock_open(device, SPEED232, LDISC_RAW)))
+ if (!(fd = refclock_open(device, SPEED232, LDISC_RAW))) {
+ pp->io.fd = -1;
return (0);
+ }
+
+ pp->io.fd = fd;
/* from refclock_palisade.c */
if (tcgetattr(fd, &tio) < 0) {
return (0);
}
memset((char *)up, 0, sizeof(struct ripencc_unit));
- pp = peer->procptr;
+
pp->io.clock_recv = ripencc_receive;
pp->io.srcclock = (caddr_t)peer;
pp->io.datalen = 0;
- pp->io.fd = fd;
if (!io_addclock(&pp->io)) {
+ /* XXX HMS: Do we need to set pp->io.fd to -1 here? */
(void) close(fd);
free(up);
return (0);
pp = peer->procptr;
up = (struct ripencc_unit *)pp->unitptr;
- if (up->handle != 0)
- time_pps_destroy(up->handle);
-
- io_closeclock(&pp->io);
+ if (up != NULL) {
+ if (up->handle != 0)
+ time_pps_destroy(up->handle);
+ free(up);
+ }
+ if (-1 != pp->io.fd)
+ io_closeclock(&pp->io);
- free(up);
+ return;
}
/*
/* set serial I/O options */
void
-md_0x35s(
+cmd_0x35s(
TSIPPKT *cmd,
unsigned char pos_code,
unsigned char vel_code,