Umulate utimes() only for systems that don't have it; this is because
authorTheodore Tso <tytso@mit.edu>
Sat, 16 Jul 1994 06:11:37 +0000 (06:11 +0000)
committerTheodore Tso <tytso@mit.edu>
Sat, 16 Jul 1994 06:11:37 +0000 (06:11 +0000)
rcp tries to set the millisecond argument, which might be significant
some day....

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@3989 dc483132-0cff-0310-8789-dd5450dbe970

src/appl/bsd/ChangeLog
src/appl/bsd/configure.in
src/appl/bsd/krcp.c

index 331c0c849633462f5ce4357453cd2559535e4aad..af5a7309ce0535b9e91d148eb53a81225ec8a55e 100644 (file)
@@ -1,3 +1,8 @@
+Fri Jul 15 15:03:11 1994  Theodore Y. Ts'o  (tytso at tsx-11)
+
+       * krcp.c: add utimes() emulation for systems that only have the
+               POSIX utime() call.
+
 Mon Jun 27 22:03:48 1994  Theodore Y. Ts'o  (tytso at tsx-11)
 
        * krlogind.c: remove spurious debugging #undef of KRB5_KRB4_COMPAT
index 3b719a30d8a726c35a7b46566edec92ed05d6b39..351481758948458d79751021b23cb83d9d191526 100644 (file)
@@ -6,6 +6,7 @@ CONFIG_RULES
 AC_SET_BUILDTOP
 AC_HAVE_LIBRARY(socket)
 AC_HAVE_LIBRARY(nsl)
+AC_FUNC_CHECK(utimes,AC_DEFINE(HAS_UTIMES))
 KRB_INCLUDE
 WITH_KRB5ROOT
 WITH_KRB4
index f874ce0649e61a714864c65d270aa992936f332a..c247a4469de99987de8f853f6c9c4c522cca6aa8 100644 (file)
@@ -737,6 +737,28 @@ krb5_sigtype
 }
 
 
+#if !defined(HAS_UTIMES)
+#include <utime.h>
+#include <sys/time.h>
+
+/*
+ * We emulate utimes() instead of utime() as necessary because
+ * utimes() is more powerful than utime(), and rcp actually tries to
+ * set the microsecond values; we don't want to take away
+ * functionality unnecessarily.
+ */
+utimes(file, tvp)
+const char *file;
+struct timeval *tvp;
+{
+       struct utimbuf times;
+
+       times.actime = tvp[0].tv_sec;
+       times.modtime = tvp[1].tv_sec;
+       return(utime(file, &times));
+}
+#endif
+
 
 sink(argc, argv)
      int argc;