Mercurial > vim
comparison src/fileio.c @ 25963:aaec2028c8fc v8.2.3515
patch 8.2.3515: nano time test fails on Mac and FreeBSD
Commit: https://github.com/vim/vim/commit/def69dffb3d09a69629b071c89b7893a1783ba53
Author: ichizok <gclient.gaap@gmail.com>
Date: Fri Oct 15 17:23:12 2021 +0100
patch 8.2.3515: nano time test fails on Mac and FreeBSD
Problem: Nano time test fails on Mac and FreeBSD.
Solution: Also check nano time when not on Linux. (Ozaki Kiichi,
closes #9000)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Fri, 15 Oct 2021 18:30:05 +0200 |
parents | d7e1cf30728c |
children | df2de1e63de0 |
comparison
equal
deleted
inserted
replaced
25962:b3b48a61ff18 | 25963:aaec2028c8fc |
---|---|
3119 } | 3119 } |
3120 | 3120 |
3121 int | 3121 int |
3122 time_differs(stat_T *st, long mtime, long mtime_ns UNUSED) | 3122 time_differs(stat_T *st, long mtime, long mtime_ns UNUSED) |
3123 { | 3123 { |
3124 return | |
3125 #ifdef ST_MTIM_NSEC | |
3126 (long)st->ST_MTIM_NSEC != mtime_ns || | |
3127 #endif | |
3124 #if defined(__linux__) || defined(MSWIN) | 3128 #if defined(__linux__) || defined(MSWIN) |
3125 // On a FAT filesystem, esp. under Linux, there are only 5 bits to store | 3129 // On a FAT filesystem, esp. under Linux, there are only 5 bits to store |
3126 // the seconds. Since the roundoff is done when flushing the inode, the | 3130 // the seconds. Since the roundoff is done when flushing the inode, the |
3127 // time may change unexpectedly by one second!!! | 3131 // time may change unexpectedly by one second!!! |
3128 return (long)st->st_mtime - mtime > 1 || mtime - (long)st->st_mtime > 1 | 3132 (long)st->st_mtime - mtime > 1 || mtime - (long)st->st_mtime > 1 |
3129 # ifdef ST_MTIM_NSEC | |
3130 || (long)st->ST_MTIM_NSEC != mtime_ns | |
3131 # endif | |
3132 ; | |
3133 #else | 3133 #else |
3134 return (long)st->st_mtime != mtime; | 3134 (long)st->st_mtime != mtime |
3135 #endif | 3135 #endif |
3136 ; | |
3136 } | 3137 } |
3137 | 3138 |
3138 /* | 3139 /* |
3139 * Return TRUE if file encoding "fenc" requires conversion from or to | 3140 * Return TRUE if file encoding "fenc" requires conversion from or to |
3140 * 'encoding'. | 3141 * 'encoding'. |