summaryrefslogtreecommitdiffstats
path: root/src/appl/bsd/krcp.c
diff options
context:
space:
mode:
authorTheodore Tso <tytso@mit.edu>1994-07-16 06:11:37 +0000
committerTheodore Tso <tytso@mit.edu>1994-07-16 06:11:37 +0000
commit36a25dca2bcaff02ac5988994672f367600703c0 (patch)
tree81484bf46915226297833bf7473067bc073d40b3 /src/appl/bsd/krcp.c
parent4bf79de2efe91758d9befa0d21770aae1ac95be8 (diff)
downloadkrb5-36a25dca2bcaff02ac5988994672f367600703c0.tar.gz
krb5-36a25dca2bcaff02ac5988994672f367600703c0.tar.xz
krb5-36a25dca2bcaff02ac5988994672f367600703c0.zip
Umulate utimes() only for systems that don't have it; this is because
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
Diffstat (limited to 'src/appl/bsd/krcp.c')
-rw-r--r--src/appl/bsd/krcp.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/appl/bsd/krcp.c b/src/appl/bsd/krcp.c
index f874ce0649..c247a4469d 100644
--- a/src/appl/bsd/krcp.c
+++ b/src/appl/bsd/krcp.c
@@ -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;