From: "Todd C. Miller" Subject: Re: vi struggling to save commit messages To: Ted Bullock Cc: gameoftrees@openbsd.org Date: Wed, 08 Mar 2023 14:20:03 -0700 On Wed, 08 Mar 2023 13:54:24 -0700, Ted Bullock wrote: > 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 OK, sb.st_mtim is the current mtime and ep->mtim is the saved mtime. So the mtime on the file has increased slightly. I'm not sure why that would be, but edit_logmsg() can be called while logmsg_path is actually closed. Closing the fd first and _then_ editing the file might avoid the problem. - todd