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.
2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
+ * 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.
+
Remove dependency on glibc malloc internals.
* alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
Move back here from lisp.h, but with their new implementations.
b->prevent_redisplay_optimizations_p = 1;
BVAR (b, backed_up) = Qnil;
BUF_AUTOSAVE_MODIFF (b) = 0;
- b->auto_save_failure_time = -1;
+ b->auto_save_failure_time = 0;
BVAR (b, auto_save_file_name) = Qnil;
BVAR (b, read_only) = Qnil;
b->overlays_before = NULL;
Redisplay of this buffer is inhibited until it changes again. */
int display_error_modiff;
/* The time at which we detected a failure to auto-save,
- Or -1 if we didn't have a failure. */
- int auto_save_failure_time;
+ Or 0 if we didn't have a failure. */
+ time_t auto_save_failure_time;
/* Position in buffer at which display started
the last time this buffer was displayed. */
EMACS_INT last_window_start;
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;
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;
}
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;
}