diff options
| author | Paul Eggert | 2012-07-03 17:04:46 -0700 |
|---|---|---|
| committer | Paul Eggert | 2012-07-03 17:04:46 -0700 |
| commit | 39adff0d6323578236a6bd9022c42460e8628629 (patch) | |
| tree | 6f51ae7a3debe203b0f6462dc260c0417df5efd9 /src/lread.c | |
| parent | dbeed9a6816f011bbf29ff9e991f38b0d0d7e5ea (diff) | |
| download | emacs-39adff0d6323578236a6bd9022c42460e8628629.tar.gz emacs-39adff0d6323578236a6bd9022c42460e8628629.zip | |
Fix bugs in file timestamp newness comparisons.
* fileio.c (Ffile_newer_than_file_p):
* lread.c (Fload): Use full timestamp resolution of files,
not just the 1-second resolution, so that files that are only
slightly newer still count as newer.
* fileio.c (Ffile_newer_than_file_p): Don't assume file
timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
Diffstat (limited to 'src/lread.c')
| -rw-r--r-- | src/lread.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/lread.c b/src/lread.c index 7a0b20880e9..1e496bf9742 100644 --- a/src/lread.c +++ b/src/lread.c | |||
| @@ -26,6 +26,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 26 | #include <errno.h> | 26 | #include <errno.h> |
| 27 | #include <limits.h> /* For CHAR_BIT. */ | 27 | #include <limits.h> /* For CHAR_BIT. */ |
| 28 | #include <setjmp.h> | 28 | #include <setjmp.h> |
| 29 | #include <stat-time.h> | ||
| 29 | #include "lisp.h" | 30 | #include "lisp.h" |
| 30 | #include "intervals.h" | 31 | #include "intervals.h" |
| 31 | #include "character.h" | 32 | #include "character.h" |
| @@ -1214,7 +1215,8 @@ Return t if the file exists and loads successfully. */) | |||
| 1214 | SSET (efound, SBYTES (efound) - 1, 'c'); | 1215 | SSET (efound, SBYTES (efound) - 1, 'c'); |
| 1215 | } | 1216 | } |
| 1216 | 1217 | ||
| 1217 | if (result == 0 && s1.st_mtime < s2.st_mtime) | 1218 | if (result == 0 |
| 1219 | && EMACS_TIME_LT (get_stat_mtime (&s1), get_stat_mtime (&s2))) | ||
| 1218 | { | 1220 | { |
| 1219 | /* Make the progress messages mention that source is newer. */ | 1221 | /* Make the progress messages mention that source is newer. */ |
| 1220 | newer = 1; | 1222 | newer = 1; |