diff options
author | ed <ed@FreeBSD.org> | 2010-03-28 13:16:08 +0000 |
---|---|---|
committer | ed <ed@FreeBSD.org> | 2010-03-28 13:16:08 +0000 |
commit | 543b5e901b744468356547ee61975d9d44fa8f32 (patch) | |
tree | 5c6d55680c37f3cbfd9460fbab60d39b1ecb8ae7 /bin | |
parent | 4f08ecd7ed8b39a0e0cd094967835fa85d105793 (diff) | |
download | FreeBSD-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 'bin')
-rw-r--r-- | bin/cp/utils.c | 4 | ||||
-rw-r--r-- | bin/ls/cmp.c | 64 | ||||
-rw-r--r-- | bin/rcp/rcp.c | 8 | ||||
-rw-r--r-- | bin/test/test.c | 6 |
4 files changed, 41 insertions, 41 deletions
diff --git a/bin/cp/utils.c b/bin/cp/utils.c index b075eac..d729bd5 100644 --- a/bin/cp/utils.c +++ b/bin/cp/utils.c @@ -323,8 +323,8 @@ setfile(struct stat *fs, int fd) fs->st_mode &= S_ISUID | S_ISGID | S_ISVTX | 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 (islink ? lutimes(to.p_path, tv) : utimes(to.p_path, tv)) { warn("%sutimes: %s", islink ? "l" : "", to.p_path); rval = 1; diff --git a/bin/ls/cmp.c b/bin/ls/cmp.c index badd108..84fb038 100644 --- a/bin/ls/cmp.c +++ b/bin/ls/cmp.c @@ -66,17 +66,17 @@ int modcmp(const FTSENT *a, const FTSENT *b) { - if (b->fts_statp->st_mtimespec.tv_sec > - a->fts_statp->st_mtimespec.tv_sec) + if (b->fts_statp->st_mtim.tv_sec > + a->fts_statp->st_mtim.tv_sec) return (1); - if (b->fts_statp->st_mtimespec.tv_sec < - a->fts_statp->st_mtimespec.tv_sec) + if (b->fts_statp->st_mtim.tv_sec < + a->fts_statp->st_mtim.tv_sec) return (-1); - if (b->fts_statp->st_mtimespec.tv_nsec > - a->fts_statp->st_mtimespec.tv_nsec) + if (b->fts_statp->st_mtim.tv_nsec > + a->fts_statp->st_mtim.tv_nsec) return (1); - if (b->fts_statp->st_mtimespec.tv_nsec < - a->fts_statp->st_mtimespec.tv_nsec) + if (b->fts_statp->st_mtim.tv_nsec < + a->fts_statp->st_mtim.tv_nsec) return (-1); return (strcoll(a->fts_name, b->fts_name)); } @@ -92,17 +92,17 @@ int acccmp(const FTSENT *a, const FTSENT *b) { - if (b->fts_statp->st_atimespec.tv_sec > - a->fts_statp->st_atimespec.tv_sec) + if (b->fts_statp->st_atim.tv_sec > + a->fts_statp->st_atim.tv_sec) return (1); - if (b->fts_statp->st_atimespec.tv_sec < - a->fts_statp->st_atimespec.tv_sec) + if (b->fts_statp->st_atim.tv_sec < + a->fts_statp->st_atim.tv_sec) return (-1); - if (b->fts_statp->st_atimespec.tv_nsec > - a->fts_statp->st_atimespec.tv_nsec) + if (b->fts_statp->st_atim.tv_nsec > + a->fts_statp->st_atim.tv_nsec) return (1); - if (b->fts_statp->st_atimespec.tv_nsec < - a->fts_statp->st_atimespec.tv_nsec) + if (b->fts_statp->st_atim.tv_nsec < + a->fts_statp->st_atim.tv_nsec) return (-1); return (strcoll(a->fts_name, b->fts_name)); } @@ -118,17 +118,17 @@ int birthcmp(const FTSENT *a, const FTSENT *b) { - if (b->fts_statp->st_birthtimespec.tv_sec > - a->fts_statp->st_birthtimespec.tv_sec) + if (b->fts_statp->st_birthtim.tv_sec > + a->fts_statp->st_birthtim.tv_sec) return (1); - if (b->fts_statp->st_birthtimespec.tv_sec < - a->fts_statp->st_birthtimespec.tv_sec) + if (b->fts_statp->st_birthtim.tv_sec < + a->fts_statp->st_birthtim.tv_sec) return (-1); - if (b->fts_statp->st_birthtimespec.tv_nsec > - a->fts_statp->st_birthtimespec.tv_nsec) + if (b->fts_statp->st_birthtim.tv_nsec > + a->fts_statp->st_birthtim.tv_nsec) return (1); - if (b->fts_statp->st_birthtimespec.tv_nsec < - a->fts_statp->st_birthtimespec.tv_nsec) + if (b->fts_statp->st_birthtim.tv_nsec < + a->fts_statp->st_birthtim.tv_nsec) return (-1); return (strcoll(a->fts_name, b->fts_name)); } @@ -144,17 +144,17 @@ int statcmp(const FTSENT *a, const FTSENT *b) { - if (b->fts_statp->st_ctimespec.tv_sec > - a->fts_statp->st_ctimespec.tv_sec) + if (b->fts_statp->st_ctim.tv_sec > + a->fts_statp->st_ctim.tv_sec) return (1); - if (b->fts_statp->st_ctimespec.tv_sec < - a->fts_statp->st_ctimespec.tv_sec) + if (b->fts_statp->st_ctim.tv_sec < + a->fts_statp->st_ctim.tv_sec) return (-1); - if (b->fts_statp->st_ctimespec.tv_nsec > - a->fts_statp->st_ctimespec.tv_nsec) + if (b->fts_statp->st_ctim.tv_nsec > + a->fts_statp->st_ctim.tv_nsec) return (1); - if (b->fts_statp->st_ctimespec.tv_nsec < - a->fts_statp->st_ctimespec.tv_nsec) + if (b->fts_statp->st_ctim.tv_nsec < + a->fts_statp->st_ctim.tv_nsec) return (-1); return (strcoll(a->fts_name, b->fts_name)); } diff --git a/bin/rcp/rcp.c b/bin/rcp/rcp.c index 0a9b7ba..2c27b63 100644 --- a/bin/rcp/rcp.c +++ b/bin/rcp/rcp.c @@ -390,8 +390,8 @@ syserr: run_err("%s: %s", name, strerror(errno)); * versions expecting microseconds. */ (void)snprintf(buf, sizeof(buf), "T%ld 0 %ld 0\n", - (long)stb.st_mtimespec.tv_sec, - (long)stb.st_atimespec.tv_sec); + (long)stb.st_mtim.tv_sec, + (long)stb.st_atim.tv_sec); (void)write(rem, buf, strlen(buf)); if (response() < 0) goto next; @@ -454,8 +454,8 @@ rsource(char *name, struct stat *statp) last++; if (pflag) { (void)snprintf(path, sizeof(path), "T%ld 0 %ld 0\n", - (long)statp->st_mtimespec.tv_sec, - (long)statp->st_atimespec.tv_sec); + (long)statp->st_mtim.tv_sec, + (long)statp->st_atim.tv_sec); (void)write(rem, path, strlen(path)); if (response() < 0) { closedir(dirp); diff --git a/bin/test/test.c b/bin/test/test.c index d7d1eec..e2062d1 100644 --- a/bin/test/test.c +++ b/bin/test/test.c @@ -572,12 +572,12 @@ newerf (const char *f1, const char *f2) if (stat(f1, &b1) != 0 || stat(f2, &b2) != 0) return 0; - if (b1.st_mtimespec.tv_sec > b2.st_mtimespec.tv_sec) + if (b1.st_mtim.tv_sec > b2.st_mtim.tv_sec) return 1; - if (b1.st_mtimespec.tv_sec < b2.st_mtimespec.tv_sec) + if (b1.st_mtim.tv_sec < b2.st_mtim.tv_sec) return 0; - return (b1.st_mtimespec.tv_nsec > b2.st_mtimespec.tv_nsec); + return (b1.st_mtim.tv_nsec > b2.st_mtim.tv_nsec); } static int |