diff options
author | Theodore Tso <tytso@mit.edu> | 1994-07-16 06:11:37 +0000 |
---|---|---|
committer | Theodore Tso <tytso@mit.edu> | 1994-07-16 06:11:37 +0000 |
commit | 36a25dca2bcaff02ac5988994672f367600703c0 (patch) | |
tree | 81484bf46915226297833bf7473067bc073d40b3 /src/appl/bsd/krcp.c | |
parent | 4bf79de2efe91758d9befa0d21770aae1ac95be8 (diff) | |
download | krb5-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.c | 22 |
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, ×)); +} +#endif + sink(argc, argv) int argc; |