diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/appl/bsd/ChangeLog | 5 | ||||
-rw-r--r-- | src/appl/bsd/configure.in | 1 | ||||
-rw-r--r-- | src/appl/bsd/krcp.c | 22 |
3 files changed, 28 insertions, 0 deletions
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 <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, ×)); +} +#endif + sink(argc, argv) int argc; |