summaryrefslogtreecommitdiffstats
path: root/usr.bin
diff options
context:
space:
mode:
authored <ed@FreeBSD.org>2010-03-28 13:16:08 +0000
committered <ed@FreeBSD.org>2010-03-28 13:16:08 +0000
commit543b5e901b744468356547ee61975d9d44fa8f32 (patch)
tree5c6d55680c37f3cbfd9460fbab60d39b1ecb8ae7 /usr.bin
parent4f08ecd7ed8b39a0e0cd094967835fa85d105793 (diff)
downloadFreeBSD-src-543b5e901b744468356547ee61975d9d44fa8f32.zip
FreeBSD-src-543b5e901b744468356547ee61975d9d44fa8f32.tar.gz
Change all our own code to use st_*tim instead of st_*timespec.
Also remove some local patches to diff(1) which are now unneeded.
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/compress/compress.c4
-rw-r--r--usr.bin/gzip/gzip.c4
-rw-r--r--usr.bin/kdump/kdump.c32
-rw-r--r--usr.bin/mail/util.c2
-rw-r--r--usr.bin/touch/touch.c12
5 files changed, 27 insertions, 27 deletions
diff --git a/usr.bin/compress/compress.c b/usr.bin/compress/compress.c
index 584f283..6f674c2 100644
--- a/usr.bin/compress/compress.c
+++ b/usr.bin/compress/compress.c
@@ -368,8 +368,8 @@ setfile(const char *name, struct stat *fs)
fs->st_mode &= S_ISUID|S_ISGID|S_IRWXU|S_IRWXG|S_IRWXO;
- TIMESPEC_TO_TIMEVAL(&tv[0], &fs->st_atimespec);
- TIMESPEC_TO_TIMEVAL(&tv[1], &fs->st_mtimespec);
+ TIMESPEC_TO_TIMEVAL(&tv[0], &fs->st_atim);
+ TIMESPEC_TO_TIMEVAL(&tv[1], &fs->st_mtim);
if (utimes(name, tv))
cwarn("utimes: %s", name);
diff --git a/usr.bin/gzip/gzip.c b/usr.bin/gzip/gzip.c
index e9371d2..e8e75aa 100644
--- a/usr.bin/gzip/gzip.c
+++ b/usr.bin/gzip/gzip.c
@@ -1088,8 +1088,8 @@ copymodes(int fd, const struct stat *sbp, const char *file)
if (fchmod(fd, sb.st_mode) < 0)
maybe_warn("couldn't fchmod: %s", file);
- TIMESPEC_TO_TIMEVAL(&times[0], &sb.st_atimespec);
- TIMESPEC_TO_TIMEVAL(&times[1], &sb.st_mtimespec);
+ TIMESPEC_TO_TIMEVAL(&times[0], &sb.st_atim);
+ TIMESPEC_TO_TIMEVAL(&times[1], &sb.st_mtim);
if (futimes(fd, times) < 0)
maybe_warn("couldn't utimes: %s", file);
diff --git a/usr.bin/kdump/kdump.c b/usr.bin/kdump/kdump.c
index 9c86fff..ec32ee7 100644
--- a/usr.bin/kdump/kdump.c
+++ b/usr.bin/kdump/kdump.c
@@ -1270,50 +1270,50 @@ ktrstat(struct stat *statp)
printf("rdev=%ju, ", (uintmax_t)statp->st_rdev);
printf("atime=");
if (resolv == 0)
- printf("%jd", (intmax_t)statp->st_atimespec.tv_sec);
+ printf("%jd", (intmax_t)statp->st_atim.tv_sec);
else {
- tm = localtime(&statp->st_atimespec.tv_sec);
+ tm = localtime(&statp->st_atim.tv_sec);
(void)strftime(timestr, sizeof(timestr), TIME_FORMAT, tm);
printf("\"%s\"", timestr);
}
- if (statp->st_atimespec.tv_nsec != 0)
- printf(".%09ld, ", statp->st_atimespec.tv_nsec);
+ if (statp->st_atim.tv_nsec != 0)
+ printf(".%09ld, ", statp->st_atim.tv_nsec);
else
printf(", ");
printf("stime=");
if (resolv == 0)
- printf("%jd", (intmax_t)statp->st_mtimespec.tv_sec);
+ printf("%jd", (intmax_t)statp->st_mtim.tv_sec);
else {
- tm = localtime(&statp->st_mtimespec.tv_sec);
+ tm = localtime(&statp->st_mtim.tv_sec);
(void)strftime(timestr, sizeof(timestr), TIME_FORMAT, tm);
printf("\"%s\"", timestr);
}
- if (statp->st_mtimespec.tv_nsec != 0)
- printf(".%09ld, ", statp->st_mtimespec.tv_nsec);
+ if (statp->st_mtim.tv_nsec != 0)
+ printf(".%09ld, ", statp->st_mtim.tv_nsec);
else
printf(", ");
printf("ctime=");
if (resolv == 0)
- printf("%jd", (intmax_t)statp->st_ctimespec.tv_sec);
+ printf("%jd", (intmax_t)statp->st_ctim.tv_sec);
else {
- tm = localtime(&statp->st_ctimespec.tv_sec);
+ tm = localtime(&statp->st_ctim.tv_sec);
(void)strftime(timestr, sizeof(timestr), TIME_FORMAT, tm);
printf("\"%s\"", timestr);
}
- if (statp->st_ctimespec.tv_nsec != 0)
- printf(".%09ld, ", statp->st_ctimespec.tv_nsec);
+ if (statp->st_ctim.tv_nsec != 0)
+ printf(".%09ld, ", statp->st_ctim.tv_nsec);
else
printf(", ");
printf("birthtime=");
if (resolv == 0)
- printf("%jd", (intmax_t)statp->st_birthtimespec.tv_sec);
+ printf("%jd", (intmax_t)statp->st_birthtim.tv_sec);
else {
- tm = localtime(&statp->st_birthtimespec.tv_sec);
+ tm = localtime(&statp->st_birthtim.tv_sec);
(void)strftime(timestr, sizeof(timestr), TIME_FORMAT, tm);
printf("\"%s\"", timestr);
}
- if (statp->st_birthtimespec.tv_nsec != 0)
- printf(".%09ld, ", statp->st_birthtimespec.tv_nsec);
+ if (statp->st_birthtim.tv_nsec != 0)
+ printf(".%09ld, ", statp->st_birthtim.tv_nsec);
else
printf(", ");
printf("size=%jd, blksize=%ju, blocks=%jd, flags=0x%x",
diff --git a/usr.bin/mail/util.c b/usr.bin/mail/util.c
index e764aac..df2d840 100644
--- a/usr.bin/mail/util.c
+++ b/usr.bin/mail/util.c
@@ -349,7 +349,7 @@ alter(name)
return;
(void)gettimeofday(&tv[0], (struct timezone *)NULL);
tv[0].tv_sec++;
- TIMESPEC_TO_TIMEVAL(&tv[1], &sb.st_mtimespec);
+ TIMESPEC_TO_TIMEVAL(&tv[1], &sb.st_mtim);
(void)utimes(name, tv);
}
diff --git a/usr.bin/touch/touch.c b/usr.bin/touch/touch.c
index 5ceb175..2148939 100644
--- a/usr.bin/touch/touch.c
+++ b/usr.bin/touch/touch.c
@@ -187,9 +187,9 @@ main(int argc, char *argv[])
}
if (!aflag)
- TIMESPEC_TO_TIMEVAL(&tv[0], &sb.st_atimespec);
+ TIMESPEC_TO_TIMEVAL(&tv[0], &sb.st_atim);
if (!mflag)
- TIMESPEC_TO_TIMEVAL(&tv[1], &sb.st_mtimespec);
+ TIMESPEC_TO_TIMEVAL(&tv[1], &sb.st_mtim);
/*
* We're adjusting the times based on the file times, not a
@@ -197,11 +197,11 @@ main(int argc, char *argv[])
*/
if (Aflag) {
if (aflag) {
- TIMESPEC_TO_TIMEVAL(&tv[0], &sb.st_atimespec);
+ TIMESPEC_TO_TIMEVAL(&tv[0], &sb.st_atim);
tv[0].tv_sec += Aflag;
}
if (mflag) {
- TIMESPEC_TO_TIMEVAL(&tv[1], &sb.st_mtimespec);
+ TIMESPEC_TO_TIMEVAL(&tv[1], &sb.st_mtim);
tv[1].tv_sec += Aflag;
}
}
@@ -368,8 +368,8 @@ stime_file(char *fname, struct timeval *tvp)
if (stat(fname, &sb))
err(1, "%s", fname);
- TIMESPEC_TO_TIMEVAL(tvp, &sb.st_atimespec);
- TIMESPEC_TO_TIMEVAL(tvp + 1, &sb.st_mtimespec);
+ TIMESPEC_TO_TIMEVAL(tvp, &sb.st_atim);
+ TIMESPEC_TO_TIMEVAL(tvp + 1, &sb.st_mtim);
}
int
OpenPOWER on IntegriCloud