From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Thu, 17 Oct 1996 09:49:45 -0400 From: presotto@plan9.bell-labs.com presotto@plan9.bell-labs.com Subject: Keeping the fileserver's clock straight Topicbox-Message-UUID: 4f9fcd0e-eac8-11e9-9e20-41e7f4b1d025 Message-ID: <19961017134945.DdeK2FHeYnJ_8XgTaGMjvUZLBF0nmLvgkHDBGEQCh8Y@z> fs used to call a clock server via datakit once every few (I think 3) hours. Datakit isn't exactly the most ubiquitous network though. What I've done lately with ours is to just have it check the time of day clock. Works well on our current boxes since the tod clocks don't seem to drift much. Here's the changes, such as they are. I'm not doing a boddle since there are some other changes in there that I don't know the origin of: in wormcopy() of main.c % diff main.c /n/juke/plan_9/sys/src/fs/port 305c305 < long nddate, ntoytime, t, dt; --- > long nddate, t, dt; 316,317d315 < ntoytime = time() + HOUR(1); < 330,342d327 < < if(t > ntoytime) { < dt = time() - rtctime(); < if(dt < 0) < dt = -dt; < if(dt > 10) < print("rtc time more than 10 secounds out\n"); < else < if(dt > 1) < settime(rtctime()); < ntoytime = time() + HOUR(1); < goto loop; < } in cmd_date() of con.c, set rtc in addition to normal time. % diff con.c /n/juke/plan_9/sys/src/fs/port 416,417d415 < setrtc(ct); <