[LinuxPPS] LinuxPPS 5.0.0-rc1
Frank Kardel
kardel at ntp.org
Sat Aug 11 13:56:08 CEST 2007
Udo van den Heuvel wrote:
> How to deal with io_closeclock in the case of two fd's?
> Does anybody know?
>
io_closeclock() should only deal with the serial (data or data+pps) file
descriptor.
If (and only if) you opened a second device for PPS you should close
that too. To find that out fdpps would be different from -1 and different
from fdserial. So the pattern would be:
if (fdpps != -1 && fdpps != fdserial) {
(void)close(fdpps);
fdpps = -1;
}
io_closeclock(fdserial);
Frank
More information about the LinuxPPS
mailing list