diff src/fileio.c @ 347:7c94d56991e1 r21-1-3

Import from CVS: tag r21-1-3
author cvs
date Mon, 13 Aug 2007 10:53:48 +0200
parents 512e409c26a2
children 4711e16a8e49
line wrap: on
line diff
--- a/src/fileio.c	Mon Aug 13 10:53:20 2007 +0200
+++ b/src/fileio.c	Mon Aug 13 10:53:48 2007 +0200
@@ -3337,18 +3337,21 @@
       }
 #endif /* HAVE_FSYNC */
 
-    /* Spurious "file has changed on disk" warnings have been
-       observed on Suns as well.
-       It seems that `close' can change the modtime, under nfs.
-
-       (This has supposedly been fixed in Sunos 4,
-       but who knows about all the other machines with NFS?)  */
-    /* On VMS and APOLLO, must do the stat after the close
-       since closing changes the modtime.  */
-    /* As it does on Windows too - kkm */
-#if !defined (WINDOWSNT) /* !defined (VMS) && !defined (APOLLO) */
-    fstat (desc, &st);
-#endif
+    /*
+     * On VMS and APOLLO, must do the stat after the close
+     * since closing changes the modtime.
+     *
+     * Spurious "file has changed on disk" warnings have been
+     * observed on Suns as well.  It seems that `close' can change
+     * the modtime, under nfs.  (This has supposedly been fixed in
+     * Sunos 4, but who knows about all the other machines with
+     * NFS?)
+     *
+     * This is reported to happen under Windows also.
+     *
+     * So we don't do the stat here.  It is done after the
+     * descriptor is closed.
+     */
 
     /* NFS can report a write failure now.  */
     if (close (desc) < 0)
@@ -3364,9 +3367,11 @@
     unbind_to (speccount, Qnil);
   }
 
-#if defined (WINDOWSNT) /* defined (VMS) || defined (APOLLO) */
+  /*
+   * stat the file after the file is closed to avoid having the
+   * modtime change on us when the file is closed.
+   */
   stat ((char *) XSTRING_DATA (fn), &st);
-#endif
 
 #ifdef CLASH_DETECTION
   if (!auto_saving)