emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r110875: Fix a race with verify-visit


From: Paul Eggert
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r110875: Fix a race with verify-visited-file-modtime.
Date: Mon, 12 Nov 2012 17:35:14 -0800
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 110875
fixes bug: http://debbugs.gnu.org/12863
committer: Paul Eggert <address@hidden>
branch nick: trunk
timestamp: Mon 2012-11-12 17:35:14 -0800
message:
  Fix a race with verify-visited-file-modtime.
  
  Since at least 1991 Emacs has ignored an mtime difference of no
  more than one second, but my guess is that this was to work around
  file system bugs that were fixed long ago.  Since the race is
  causing problems now, let's remove that code.
  * fileio.c (Fverify_visited_file_modtime): Do not accept a file
  whose time stamp is off by no more than a second.  Insist that the
  file time stamps match exactly.
modified:
  src/ChangeLog
  src/fileio.c
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2012-11-12 16:02:46 +0000
+++ b/src/ChangeLog     2012-11-13 01:35:14 +0000
@@ -1,3 +1,14 @@
+2012-11-13  Paul Eggert  <address@hidden>
+
+       Fix a race with verify-visited-file-modtime (Bug#12863).
+       Since at least 1991 Emacs has ignored an mtime difference of no
+       more than one second, but my guess is that this was to work around
+       file system bugs that were fixed long ago.  Since the race is
+       causing problems now, let's remove that code.
+       * fileio.c (Fverify_visited_file_modtime): Do not accept a file
+       whose time stamp is off by no more than a second.  Insist that the
+       file time stamps match exactly.
+
 2012-11-12  Dmitry Antipov  <address@hidden>
 
        * frame.h (struct frame): Convert external_tool_bar member to

=== modified file 'src/fileio.c'
--- a/src/fileio.c      2012-10-19 19:25:18 +0000
+++ b/src/fileio.c      2012-11-13 01:35:14 +0000
@@ -5076,7 +5076,7 @@
   struct stat st;
   Lisp_Object handler;
   Lisp_Object filename;
-  EMACS_TIME mtime, diff;
+  EMACS_TIME mtime;
 
   if (NILP (buf))
     b = current_buffer;
@@ -5101,13 +5101,7 @@
   mtime = (stat (SSDATA (filename), &st) == 0
           ? get_stat_mtime (&st)
           : time_error_value (errno));
-  if ((EMACS_TIME_EQ (mtime, b->modtime)
-       /* If both exist, accept them if they are off by one second.  */
-       || (EMACS_TIME_VALID_P (mtime) && EMACS_TIME_VALID_P (b->modtime)
-          && ((diff = (EMACS_TIME_LT (mtime, b->modtime)
-                       ? sub_emacs_time (b->modtime, mtime)
-                       : sub_emacs_time (mtime, b->modtime))),
-              EMACS_TIME_LE (diff, make_emacs_time (1, 0)))))
+  if (EMACS_TIME_EQ (mtime, b->modtime)
       && (st.st_size == b->modtime_size
           || b->modtime_size < 0))
     return Qt;


reply via email to

[Prev in Thread] Current Thread [Next in Thread]