From: Ted Bullock Subject: Re: vi struggling to save commit messages To: "Todd C. Miller" Cc: gameoftrees@openbsd.org Date: Wed, 8 Mar 2023 14:20:02 -0700 On 2023-03-08 1:54 p.m., Ted Bullock wrote: > > On 2023-03-08 1:24 p.m., Todd C. Miller wrote: >> On Wed, 08 Mar 2023 13:19:39 -0700, Ted Bullock wrote: >> >>> I can see why it triggers, it's comparing identical timestamps, not >>> relative. This is inconsistent with the error text too which explicitly >>> says "file modified more recently than this copy". >>> >>> timespeccmp(&sb.st_mtim, &ep->mtim, !=) >>> >>> should be >>> >>> timespeccmp(&sb.st_mtim, &ep->mtim, <=) >> >> Are you saying that the current mtime is _older_ than the original? >> Is this just a matter of the nsec portion being truncated? >> >> - todd > > Here is a sample of the actual numbers, it's not a truncation. > > sb.st_mtim.tv_sec: 1678308226, sb.st_mtim.tv_nsec: 125222348 > ep->mtim.tv_sec: 1678308226, ep->mtim.tv_nsec: 55250221 > sb.st_mtim.tv_sec: 1678309512, sb.st_mtim.tv_nsec: 345233906 ep->mtim.tv_sec: 1678309512, ep->mtim.tv_nsec: 265227205 Diff in Nanoseconds: 80006701 sb.st_mtim.tv_sec: 1678309597, sb.st_mtim.tv_nsec: 395231222 ep->mtim.tv_sec: 1678309597, ep->mtim.tv_nsec: 335248371 Diff in Nanoseconds: 59982851 sb.st_mtim.tv_sec: 1678309689, sb.st_mtim.tv_nsec: 345222289 ep->mtim.tv_sec: 1678309689, ep->mtim.tv_nsec: 285228238 Diff in Nanoseconds: 59994051 Some further tests, ep->mtim is running around 0.6 to 0.8 seconds ahead. -- Ted Bullock