Deleted Added
full compact
compare.c (121734) compare.c (121798)
1/*-
2 * Copyright (c) 1989, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 19 unchanged lines hidden (view full) ---

28 */
29
30#if 0
31#ifndef lint
32static char sccsid[] = "@(#)compare.c 8.1 (Berkeley) 6/6/93";
33#endif /* not lint */
34#endif
35#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 1989, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 19 unchanged lines hidden (view full) ---

28 */
29
30#if 0
31#ifndef lint
32static char sccsid[] = "@(#)compare.c 8.1 (Berkeley) 6/6/93";
33#endif /* not lint */
34#endif
35#include <sys/cdefs.h>
36__FBSDID("$FreeBSD: head/usr.sbin/mtree/compare.c 121734 2003-10-30 12:03:25Z phk $");
36__FBSDID("$FreeBSD: head/usr.sbin/mtree/compare.c 121798 2003-10-31 13:39:19Z phk $");
37
38#include <sys/param.h>
39#include <sys/stat.h>
40#include <vis.h>
41#include <err.h>
42#include <errno.h>
43#include <fcntl.h>
44#include <fts.h>

--- 134 unchanged lines hidden (view full) ---

179 * Catches nano-second differences, but doesn't display them.
180 */
181 if ((s->flags & F_TIME) &&
182 ((s->st_mtimespec.tv_sec != p->fts_statp->st_mtimespec.tv_sec) ||
183 (s->st_mtimespec.tv_nsec != p->fts_statp->st_mtimespec.tv_nsec))) {
184 LABEL;
185 (void)printf("%smodification time expected %.24s ",
186 tab, ctime(&s->st_mtimespec.tv_sec));
37
38#include <sys/param.h>
39#include <sys/stat.h>
40#include <vis.h>
41#include <err.h>
42#include <errno.h>
43#include <fcntl.h>
44#include <fts.h>

--- 134 unchanged lines hidden (view full) ---

179 * Catches nano-second differences, but doesn't display them.
180 */
181 if ((s->flags & F_TIME) &&
182 ((s->st_mtimespec.tv_sec != p->fts_statp->st_mtimespec.tv_sec) ||
183 (s->st_mtimespec.tv_nsec != p->fts_statp->st_mtimespec.tv_nsec))) {
184 LABEL;
185 (void)printf("%smodification time expected %.24s ",
186 tab, ctime(&s->st_mtimespec.tv_sec));
187 (void)printf("found %.24s\n",
187 (void)printf("found %.24s",
188 ctime(&p->fts_statp->st_mtimespec.tv_sec));
188 ctime(&p->fts_statp->st_mtimespec.tv_sec));
189 if (uflag) {
190 struct timeval tv[2];
191 tv[0].tv_sec = s->st_mtimespec.tv_sec;
192 tv[0].tv_usec = s->st_mtimespec.tv_nsec / 1000;
193 tv[1] = tv[0];
194 if (utimes(p->fts_accpath, tv))
195 (void)printf(" not modified: %s\n",
196 strerror(errno));
197 else
198 (void)printf(" modified\n");
199 } else
200 (void)printf("\n");
201
189 tab = "\t";
190 }
191 if (s->flags & F_CKSUM) {
192 if ((fd = open(p->fts_accpath, O_RDONLY, 0)) < 0) {
193 LABEL;
194 (void)printf("%scksum: %s: %s\n",
195 tab, p->fts_accpath, strerror(errno));
196 tab = "\t";

--- 167 unchanged lines hidden ---
202 tab = "\t";
203 }
204 if (s->flags & F_CKSUM) {
205 if ((fd = open(p->fts_accpath, O_RDONLY, 0)) < 0) {
206 LABEL;
207 (void)printf("%scksum: %s: %s\n",
208 tab, p->fts_accpath, strerror(errno));
209 tab = "\t";

--- 167 unchanged lines hidden ---