A negative return value from read in the ntpserver loop should not terminate the server. If the timesource is GPS, announce it in the NTP packets sent. Reference: /n/sources/patch/applied/ftimesync-as-server Date: Fri Nov 9 13:36:10 CET 2007 Signed-off-by: matthiasb@acm.org --- /sys/src/cmd/aux/timesync.c Fri Nov 9 13:33:21 2007 +++ /sys/src/cmd/aux/timesync.c Fri Nov 9 13:33:15 2007 @@ -1123,6 +1123,7 @@ sysfatal("open %s: %r", data); return fd; } + static void ntpserver(char *servenet) { @@ -1144,6 +1145,9 @@ case Utc: Rootid = "UTC"; break; + case Gps: + Rootid = "GPS"; + break; case Ntp: /* set by the ntp client */ break; @@ -1155,7 +1159,7 @@ n = read(fd, buf, sizeof buf); gettime(&recvts, 0, 0); if(n < 0) - return; + continue; if(n < Udphdrsize + NTPSIZE) continue;