Adjust clock gradually when possible

Use adjtime instead of settimeofday when device time is within 30
seconds of the real time. The clock jumping backwards can make certain
logs difficult to understand, and adjtime preserves clock monotonicity.

BUG=chromium:907304
TEST=ensure clock doesn't move backwards after boot

Change-Id: I4efd081c456cecd228037aa9f8d0b927baaf2029
Reviewed-on: https://chromium-review.googlesource.com/1344802
Commit-Ready: Christopher Morin <cmtm@google.com>
Tested-by: Christopher Morin <cmtm@google.com>
Reviewed-by: Dan Erat <derat@chromium.org>
4 files changed