diff src/sysdep.c @ 460:223736d75acb r21-2-45

Import from CVS: tag r21-2-45
author cvs
date Mon, 13 Aug 2007 11:43:24 +0200
parents 3d3049ae1304
children 0784d089fdc9
line wrap: on
line diff
--- a/src/sysdep.c	Mon Aug 13 11:42:27 2007 +0200
+++ b/src/sysdep.c	Mon Aug 13 11:43:24 2007 +0200
@@ -140,22 +140,6 @@
 #include <sys/termio.h>
 #endif
 
-/* ------------------------------- */
-/*          miscellaneous          */
-/* ------------------------------- */
-
-#ifndef HAVE_UTIMES
-#ifndef HAVE_STRUCT_UTIMBUF
-/* We want to use utime rather than utimes, but we couldn't find the
-   structure declaration.  We'll use the traditional one.  */
-struct utimbuf
-{
-  long actime;
-  long modtime;
-};
-#endif
-#endif
-
 
 /************************************************************************/
 /*                         subprocess control                           */
@@ -3364,17 +3348,20 @@
 int
 set_file_times (char *filename, EMACS_TIME atime, EMACS_TIME mtime)
 {
-#ifdef HAVE_UTIMES
+#if defined (HAVE_UTIME)
+  struct utimbuf utb;
+  utb.actime = EMACS_SECS (atime);
+  utb.modtime = EMACS_SECS (mtime);
+  return utime (filename, &utb);
+#elif defined (HAVE_UTIMES)
   struct timeval tv[2];
   tv[0] = atime;
   tv[1] = mtime;
   return utimes (filename, tv);
-#else /* not HAVE_UTIMES */
-  struct utimbuf utb;
-  utb.actime = EMACS_SECS (atime);
-  utb.modtime = EMACS_SECS (mtime);
-  return utime (filename, &utb);
-#endif /* not HAVE_UTIMES */
+#else
+  /* No file times setting function available. */
+  return -1;
+#endif
 }
 
 /* */