From ff717da2cf625e3d07537a93a4c240692fa55bd6 Mon Sep 17 00:00:00 2001 From: Ollivier Robert Date: Mon, 18 Aug 2008 14:26:05 +0000 Subject: Import ntp 4.2.4p5 in the vendor code area. Far too many changes to list here, please see CommitLog for detailed changes. XXX html/build/hints/solaris.xtra.4095849 is not being imported as it conflicts with the detect-merge-conflict.sh script in our repo. --- ntpd/refclock_datum.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'ntpd/refclock_datum.c') diff --git a/ntpd/refclock_datum.c b/ntpd/refclock_datum.c index 82b73690f46d7..b26fe73cfc9ec 100644 --- a/ntpd/refclock_datum.c +++ b/ntpd/refclock_datum.c @@ -119,6 +119,7 @@ #define REFID "DATM" /* reference id */ #define DATUM_DISPERSION 0 /* fixed dispersion = 0 ms */ #define DATUM_MAX_ERROR 0.100 /* limits on sigma squared */ +#define DATUM_DEV "/dev/datum" /* device name */ #define DATUM_MAX_ERROR2 (DATUM_MAX_ERROR*DATUM_MAX_ERROR) @@ -233,6 +234,7 @@ datum_pts_start( { struct datum_pts_unit **temp_datum_pts_unit; struct datum_pts_unit *datum_pts; + int fd; #ifdef HAVE_TERMIOS struct termios arg; #endif @@ -242,6 +244,16 @@ datum_pts_start( printf("Starting Datum PTS unit %d\n", unit); #endif + /* + ** Open the Datum PTS device + */ + fd = open(DATUM_DEV, O_RDWR); + + if (fd < 0) { + msyslog(LOG_ERR, "Datum_PTS: open(\"%s\", O_RDWR) failed: %m", DATUM_DEV); + return 0; + } + /* ** Create the memory for the new unit */ @@ -260,11 +272,7 @@ datum_pts_start( datum_pts->yearstart = 0; /* initialize the yearstart to 0 */ datum_pts->sigma2 = 0.0; /* initialize the sigma2 to 0 */ - /* - ** Open the Datum PTS device - */ - - datum_pts->PTS_fd = open("/dev/datum",O_RDWR); + datum_pts->PTS_fd = fd; fcntl(datum_pts->PTS_fd, F_SETFL, 0); /* clear the descriptor flags */ -- cgit v1.2.3