changeset 564:d909f2be7ee1

*** empty log message ***
author Jim Blandy <jimb@redhat.com>
date Sun, 23 Feb 1992 10:18:09 +0000
parents 5080bb8d0593
children 6f08bfb2c11c
files src/fileio.c
diffstat 1 files changed, 7 insertions(+), 29 deletions(-) [+]
line wrap: on
line diff
--- a/src/fileio.c	Sun Feb 23 07:59:34 1992 +0000
+++ b/src/fileio.c	Sun Feb 23 10:18:09 1992 +0000
@@ -22,7 +22,7 @@
 #include <sys/stat.h>
 
 #ifdef VMS
-#include "pwd.h"
+#include "vms-pwd.h"
 #else
 #include <pwd.h>
 #endif
@@ -64,13 +64,7 @@
 #include <nam.h>
 #endif
 
-#ifdef NEED_TIME_H
-#include <time.h>
-#else /* not NEED_TIME_H */
-#ifdef HAVE_TIMEVAL
-#include <sys/time.h>
-#endif /* HAVE_TIMEVAL */
-#endif /* not NEED_TIME_H */
+#include "systime.h"
 
 #ifdef HPUX
 #include <netio.h>
@@ -1417,33 +1411,17 @@
 
   if (fstat (ifd, &st) >= 0)
     {
-#ifdef HAVE_TIMEVAL
       if (!NILP (keep_date))
 	{
-#ifdef USE_UTIME
-/* AIX has utimes() in compatibility package, but it dies.  So use good old
-   utime interface instead. */
-	  struct {
-	    time_t atime;
-	    time_t mtime;
-	  } tv;
-	  tv.atime = st.st_atime;
-	  tv.mtime = st.st_mtime;
-	  utime (XSTRING (newname)->data, &tv);
-#else /* not USE_UTIME */
-	  struct timeval timevals[2];
-	  timevals[0].tv_sec = st.st_atime;
-	  timevals[1].tv_sec = st.st_mtime;
-	  timevals[0].tv_usec = timevals[1].tv_usec = 0;
-	  utimes (XSTRING (newname)->data, timevals);
-#endif /* not USE_UTIME */
+	  EMACS_TIME atime, mtime;
+	  EMACS_SET_SECS_USECS (atime, st.st_atime, 0);
+	  EMACS_SET_SECS_USECS (mtime, st.st_mtime, 0);
+	  EMACS_SET_UTIMES (XSTRING (newname)->data, atime, mtime);
 	}
-#endif /* HAVE_TIMEVALS */
-
 #ifdef APOLLO
       if (!egetenv ("USE_DOMAIN_ACLS"))
 #endif
-      chmod (XSTRING (newname)->data, st.st_mode & 07777);
+	chmod (XSTRING (newname)->data, st.st_mode & 07777);
     }
 
   close (ifd);