From 36a25dca2bcaff02ac5988994672f367600703c0 Mon Sep 17 00:00:00 2001 From: Theodore Tso Date: Sat, 16 Jul 1994 06:11:37 +0000 Subject: [PATCH] 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 --- src/appl/bsd/ChangeLog | 5 +++++ src/appl/bsd/configure.in | 1 + src/appl/bsd/krcp.c | 22 ++++++++++++++++++++++ 3 files changed, 28 insertions(+) diff --git a/src/appl/bsd/ChangeLog b/src/appl/bsd/ChangeLog index 331c0c849..af5a7309c 100644 --- a/src/appl/bsd/ChangeLog +++ b/src/appl/bsd/ChangeLog @@ -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 diff --git a/src/appl/bsd/configure.in b/src/appl/bsd/configure.in index 3b719a30d..351481758 100644 --- a/src/appl/bsd/configure.in +++ b/src/appl/bsd/configure.in @@ -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 diff --git a/src/appl/bsd/krcp.c b/src/appl/bsd/krcp.c index f874ce064..c247a4469 100644 --- a/src/appl/bsd/krcp.c +++ b/src/appl/bsd/krcp.c @@ -737,6 +737,28 @@ krb5_sigtype } +#if !defined(HAS_UTIMES) +#include +#include + +/* + * 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, ×)); +} +#endif + sink(argc, argv) int argc; -- 2.26.2