From 3047eff89eb18de636c47c0d75f186178a258a68 Mon Sep 17 00:00:00 2001 From: Theodore Tso Date: Fri, 15 Jul 1994 20:05:57 +0000 Subject: [PATCH] Use POSIX utime() instead of non-posix utimes() git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@3979 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/kdb/ChangeLog | 6 ++++++ src/lib/kdb/kdb_dbm.c | 16 ++++++---------- 2 files changed, 12 insertions(+), 10 deletions(-) create mode 100644 src/lib/kdb/ChangeLog diff --git a/src/lib/kdb/ChangeLog b/src/lib/kdb/ChangeLog new file mode 100644 index 000000000..f2b496d28 --- /dev/null +++ b/src/lib/kdb/ChangeLog @@ -0,0 +1,6 @@ +Fri Jul 15 14:54:10 1994 Theodore Y. Ts'o (tytso at tsx-11) + + * kdb_dbm.c (krb5_dbm_db_end_update): Change use of utimes() to + the POSIX utime() function. + + diff --git a/src/lib/kdb/kdb_dbm.c b/src/lib/kdb/kdb_dbm.c index 5a6712f1d..9642ce289 100644 --- a/src/lib/kdb/kdb_dbm.c +++ b/src/lib/kdb/kdb_dbm.c @@ -36,10 +36,8 @@ static char rcsid_krb_dbm_c[] = #include #include #include - -#if (defined(mips) && defined(SYSTYPE_BSD43)) || defined(aix) -#include -#endif +#include +#include #if defined (POSIX_FILE_LOCKS) && !defined(unicos61) #include @@ -381,16 +379,14 @@ time_t age; retval = errno; else { struct stat st; - struct timeval tv[2]; + struct utimbuf times; /* only set the time if the new file is "newer" than "age" */ if ((fstat (fd, &st) == 0) && (st.st_mtime <= age)) { - tv[0].tv_sec = st.st_atime; - tv[0].tv_usec = 0; - tv[1].tv_sec = age; /* mod time */ - tv[1].tv_usec = 0; + times.actime = st.st_atime; + times.modtime = age; /* set the mod timetimes.. */ - utimes (new_okname, tv); + utime(new_okname, ×); #ifndef NOFSYNC fsync(fd); #endif -- 2.26.2