Bad timespec_subtract() calculations produce negative tv_nsec on i386
authorache <ache@FreeBSD.org>
Sat, 25 Jan 2014 02:16:09 +0000 (02:16 +0000)
committerache <ache@FreeBSD.org>
Sat, 25 Jan 2014 02:16:09 +0000 (02:16 +0000)
commit6c067c7c3d9fcb334fcebc6d3f2e1760fc851f21
treebef31efec5573d3961cf61e55bd8100c7d400109
parent47bb874dd7e85e87b14129162d6382b344ebdbf8
Bad timespec_subtract() calculations produce negative tv_nsec on i386
which cause EINVAL returned from nanosleep() which cause loop in
cron_sleep() and making all cron jobs to start about 30 seconds earlier
(which cause f.e. logfiles rotation by newsyslog delayed by 1 hour).

Use simple and proved calculations from kernel's timespecsub() instead.

MFC after:      3 days
usr.sbin/cron/cron/cron.c