"clock correction %d sec too large to adjust",
"clock correction %ld sec too large to adjust",
adjclock(struct timeval *corr){	static int passes = 0;	static int smoother = 0;	long delta;			/* adjustment in usec */	long ndelta;	struct timeval now;	struct timeval adj;	if (!timerisset(corr))		return;	adj = *corr;	if (adj.tv_sec < MAXADJ && adj.tv_sec > - MAXADJ) {		delta = adj.tv_sec*1000000 + adj.tv_usec;		/* If the correction is less than the minimum round		 *	trip time for an ICMP packet, and thus		 *	less than the likely error in the measurement,		 *	do not do the entire correction.  Do half		 *	or a quarter of it.		 */		if (delta > -MIN_ROUND*1000		    && delta < MIN_ROUND*1000) {			if (smoother <= 4)				smoother++;			ndelta = delta >> smoother;			if (trace)				fprintf(fd,					"trimming delta %ld usec to %ld\n",					delta, ndelta);			adj.tv_usec = ndelta;			adj.tv_sec = 0;		} else if (smoother > 0) {			smoother--;		}		if (0 > adjtime(corr, 0)) {			syslog(LOG_ERR, "adjtime: %m");		}		if (passes > 1		    && (delta < -BIG_ADJ || delta > BIG_ADJ)) {			smoother = 0;			passes = 0;			syslog(LOG_WARNING,			       "large time adjustment of %+.3f sec",			       delta/1000000.0);		}	} else {		syslog(LOG_WARNING,		       "clock correction %d sec too large to adjust",		       adj.tv_sec);		(void) gettimeofday(&now, 0);		timeradd(&now, corr, &now);		if (settimeofday(&now, 0) < 0)			syslog(LOG_ERR, "settimeofday: %m");	}#ifdef sgi	/* Accumulate the total change, and use it to adjust the basic	 * clock rate.	 */	if (++passes > 2) {#define F_USEC_PER_SEC	(1000000*1.0)	/* reduce typos */#define F_NSEC_PER_SEC	(F_USEC_PER_SEC*1000.0)		extern char *timetrim_fn;		extern char *timetrim_wpat;		extern long timetrim;		extern double tot_adj, hr_adj;	/* totals in nsec */		extern double tot_ticks, hr_ticks;		static double nag_tick;		double cur_ticks, hr_delta_ticks, tot_delta_ticks;		double tru_tot_adj, tru_hr_adj; /* nsecs of adjustment */		double tot_trim, hr_trim;   /* nsec/sec */		struct tms tm;		FILE *timetrim_st;		cur_ticks = times(&tm);		tot_adj += delta*1000.0;		hr_adj += delta*1000.0;		tot_delta_ticks = cur_ticks-tot_ticks;		if (tot_delta_ticks >= 16*SECDAY*CLK_TCK) {			tot_adj -= rint(tot_adj/16);			tot_ticks += rint(tot_delta_ticks/16);			tot_delta_ticks = cur_ticks-tot_ticks;		}		hr_delta_ticks = cur_ticks-hr_ticks;		tru_hr_adj = hr_adj + timetrim*rint(hr_delta_ticks/CLK_TCK);		tru_tot_adj = (tot_adj			       + timetrim*rint(tot_delta_ticks/CLK_TCK));		if (hr_delta_ticks >= SECDAY*CLK_TCK		    || (tot_delta_ticks < 4*SECDAY*CLK_TCK			&& hr_delta_ticks >= SECHR*CLK_TCK)		    || (trace && hr_delta_ticks >= (SECHR/10)*CLK_TCK)) {			tot_trim = rint(tru_tot_adj*CLK_TCK/tot_delta_ticks);			hr_trim = rint(tru_hr_adj*CLK_TCK/hr_delta_ticks);			if (trace			    || (abs(timetrim - hr_trim) > 100000.0				&& 0 == timetrim_fn				&& ((cur_ticks - nag_tick)				    >= 24*SECDAY*CLK_TCK))) {				nag_tick = cur_ticks;				syslog(LOG_NOTICE,		   "%+.3f/%.2f or %+.3f/%.2f sec/hr; timetrim=%+.0f or %+.0f",				       tru_tot_adj/F_NSEC_PER_SEC,				       tot_delta_ticks/(SECHR*CLK_TCK*1.0),				       tru_hr_adj/F_NSEC_PER_SEC,				       hr_delta_ticks/(SECHR*CLK_TCK*1.0),				       tot_trim,				       hr_trim);			}			if (tot_trim < -MAX_TRIM || tot_trim > MAX_TRIM) {				tot_ticks = hr_ticks;				tot_adj = hr_adj;			} else if (0 > syssgi(SGI_SETTIMETRIM,					      (long)tot_trim)) {				syslog(LOG_ERR, "SETTIMETRIM(%d): %m",				       (long)tot_trim);			} else {				if (0 != timetrim_fn) {				    timetrim_st = fopen(timetrim_fn, "w");				    if (0 == timetrim_st) {					syslog(LOG_ERR, "fopen(%s): %m",					       timetrim_fn);				    } else {					if (0 > fprintf(timetrim_st,							timetrim_wpat,							(long)tot_trim,							tru_tot_adj,							tot_delta_ticks)) {						syslog(LOG_ERR,						       "fprintf(%s): %m",						       timetrim_fn);					}					(void)fclose(timetrim_st);				    }				}				tot_adj -= ((tot_trim - timetrim)					    * rint(tot_delta_ticks/CLK_TCK));				timetrim = tot_trim;			}			hr_ticks = cur_ticks;			hr_adj = 0;		}	}#endif /* sgi */}