summaryrefslogtreecommitdiffstats
path: root/usr.sbin/mtree
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/mtree')
-rw-r--r--usr.sbin/mtree/compare.c22
1 files changed, 9 insertions, 13 deletions
diff --git a/usr.sbin/mtree/compare.c b/usr.sbin/mtree/compare.c
index fbe9775..108d16e 100644
--- a/usr.sbin/mtree/compare.c
+++ b/usr.sbin/mtree/compare.c
@@ -37,7 +37,8 @@ __FBSDID("$FreeBSD$");
#include <sys/param.h>
#include <sys/stat.h>
-#include <vis.h>
+#include <sys/time.h>
+
#include <err.h>
#include <errno.h>
#include <fcntl.h>
@@ -45,16 +46,18 @@ __FBSDID("$FreeBSD$");
#ifdef MD5
#include <md5.h>
#endif
-#ifdef SHA1
-#include <sha.h>
-#endif
#ifdef RMD160
#include <ripemd.h>
#endif
+#ifdef SHA1
+#include <sha.h>
+#endif
#include <stdint.h>
#include <stdio.h>
#include <time.h>
#include <unistd.h>
+#include <vis.h>
+
#include "mtree.h"
#include "extern.h"
@@ -73,6 +76,7 @@ static const char *ftype(u_int);
int
compare(char *name __unused, NODE *s, FTSENT *p)
{
+ struct timeval tv[2];
uint32_t val;
int fd, label;
off_t len;
@@ -187,7 +191,6 @@ typeerr: LABEL;
(void)printf("found %.24s",
ctime(&p->fts_statp->st_mtimespec.tv_sec));
if (uflag) {
- struct timeval tv[2];
tv[0].tv_sec = s->st_mtimespec.tv_sec;
tv[0].tv_usec = s->st_mtimespec.tv_nsec / 1000;
tv[1] = tv[0];
@@ -198,7 +201,6 @@ typeerr: LABEL;
(void)printf(" modified\n");
} else
(void)printf("\n");
-
tab = "\t";
}
if (s->flags & F_CKSUM) {
@@ -223,12 +225,6 @@ typeerr: LABEL;
}
}
}
- /*
- * XXX
- * since chflags(2) will reset file times, the utimes() above
- * may have been useless! oh well, we'd rather have correct
- * flags, rather than times?
- */
if ((s->flags & F_FLAGS) && s->st_flags != p->fts_statp->st_flags) {
LABEL;
fflags = flags_to_string(s->st_flags);
@@ -364,9 +360,9 @@ ftype(u_int type)
char *
rlink(char *name)
{
- char tbuf[MAXPATHLEN];
static char lbuf[MAXPATHLEN * 4];
int len;
+ char tbuf[MAXPATHLEN];
if ((len = readlink(name, tbuf, sizeof(tbuf) - 1)) == -1)
err(1, "line %d: %s", lineno, name);
OpenPOWER on IntegriCloud