ts_sec -> tv_sec
ts_nsec -> tv_nsec Pointed out by: bde
This commit is contained in:
parent
4a684684f4
commit
2514dd6975
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=18404
@ -171,13 +171,13 @@ typeerr: LABEL;
|
||||
* Catches nano-second differences, but doesn't display them.
|
||||
*/
|
||||
if ((s->flags & F_TIME) &&
|
||||
((s->st_mtimespec.ts_sec != p->fts_statp->st_mtimespec.ts_sec) ||
|
||||
(s->st_mtimespec.ts_nsec != p->fts_statp->st_mtimespec.ts_nsec))) {
|
||||
((s->st_mtimespec.tv_sec != p->fts_statp->st_mtimespec.tv_sec) ||
|
||||
(s->st_mtimespec.tv_nsec != p->fts_statp->st_mtimespec.tv_nsec))) {
|
||||
LABEL;
|
||||
(void)printf("%smodification time (%.24s, ",
|
||||
tab, ctime(&s->st_mtimespec.ts_sec));
|
||||
tab, ctime(&s->st_mtimespec.tv_sec));
|
||||
(void)printf("%.24s)\n",
|
||||
ctime(&p->fts_statp->st_mtimespec.ts_sec));
|
||||
ctime(&p->fts_statp->st_mtimespec.tv_sec));
|
||||
tab = "\t";
|
||||
}
|
||||
if (s->flags & F_CKSUM)
|
||||
|
@ -179,8 +179,8 @@ statf(indent, p)
|
||||
output(indent, &offset, "size=%qd", p->fts_statp->st_size);
|
||||
if (keys & F_TIME)
|
||||
output(indent, &offset, "time=%ld.%ld",
|
||||
p->fts_statp->st_mtimespec.ts_sec,
|
||||
p->fts_statp->st_mtimespec.ts_nsec);
|
||||
p->fts_statp->st_mtimespec.tv_sec,
|
||||
p->fts_statp->st_mtimespec.tv_nsec);
|
||||
if (keys & F_CKSUM && S_ISREG(p->fts_statp->st_mode)) {
|
||||
if ((fd = open(p->fts_accpath, O_RDONLY, 0)) < 0 ||
|
||||
crc(fd, &val, &len))
|
||||
|
@ -220,11 +220,11 @@ set(t, ip)
|
||||
err("%s", strerror(errno));
|
||||
break;
|
||||
case F_TIME:
|
||||
ip->st_mtimespec.ts_sec = strtoul(val, &ep, 10);
|
||||
ip->st_mtimespec.tv_sec = strtoul(val, &ep, 10);
|
||||
if (*ep != '.')
|
||||
err("invalid time %s", val);
|
||||
val = ep + 1;
|
||||
ip->st_mtimespec.ts_nsec = strtoul(val, &ep, 10);
|
||||
ip->st_mtimespec.tv_nsec = strtoul(val, &ep, 10);
|
||||
if (*ep)
|
||||
err("invalid time %s", val);
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user