summaryrefslogtreecommitdiff
path: root/src/fileio.c
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2011-09-30 13:22:01 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2011-09-30 13:22:01 -0700
commit4222c55da73988a2bf397184e46505fc9a52f8b4 (patch)
tree42ccf25d299fbf1ad4030b0d613c7d3bca89edde /src/fileio.c
parent9229fe8763afbfe5e416b8d6826307282bd84b60 (diff)
downloademacs-4222c55da73988a2bf397184e46505fc9a52f8b4.tar.gz
emacs-4222c55da73988a2bf397184e46505fc9a52f8b4.tar.bz2
emacs-4222c55da73988a2bf397184e46505fc9a52f8b4.zip
* buffer.h (struct buffer): Use time_t, not int, for a time stamp.
This fixes a Y2038 bug on 64-bit hosts. * buffer.c (reset_buffer): * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved) (Fclear_buffer_auto_save_failure): Use 0, not -1, to represent an unset failure time, since time_t might not be signed.
Diffstat (limited to 'src/fileio.c')
-rw-r--r--src/fileio.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/fileio.c b/src/fileio.c
index e335dcf027f..44a85ab1977 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -5344,7 +5344,7 @@ A non-nil CURRENT-ONLY argument means save only current buffer. */)
EMACS_GET_TIME (before_time);
/* If we had a failure, don't try again for 20 minutes. */
- if (b->auto_save_failure_time >= 0
+ if (b->auto_save_failure_time > 0
&& EMACS_SECS (before_time) - b->auto_save_failure_time < 1200)
continue;
@@ -5423,7 +5423,7 @@ No auto-save file will be written until the buffer changes again. */)
they're not autosaved. */
BUF_AUTOSAVE_MODIFF (current_buffer) = MODIFF;
XSETFASTINT (BVAR (current_buffer, save_length), Z - BEG);
- current_buffer->auto_save_failure_time = -1;
+ current_buffer->auto_save_failure_time = 0;
return Qnil;
}
@@ -5432,7 +5432,7 @@ DEFUN ("clear-buffer-auto-save-failure", Fclear_buffer_auto_save_failure,
doc: /* Clear any record of a recent auto-save failure in the current buffer. */)
(void)
{
- current_buffer->auto_save_failure_time = -1;
+ current_buffer->auto_save_failure_time = 0;
return Qnil;
}