summaryrefslogtreecommitdiffstats
path: root/usr.sbin/mtree/compare.c
diff options
context:
space:
mode:
authorrgrimes <rgrimes@FreeBSD.org>1994-09-18 21:17:40 +0000
committerrgrimes <rgrimes@FreeBSD.org>1994-09-18 21:17:40 +0000
commitb98c90be2e4e7635f6a431fe21bd5927a850b840 (patch)
treecec1784f94e1baa76dfd3637e01e44d44396d0a6 /usr.sbin/mtree/compare.c
parent10e98516daf367390bc752990d2da01ac56b167a (diff)
downloadFreeBSD-src-b98c90be2e4e7635f6a431fe21bd5927a850b840.zip
FreeBSD-src-b98c90be2e4e7635f6a431fe21bd5927a850b840.tar.gz
1. Remove commented out CFLAGS+=-DDEBUG from Makefile
2. Clean up code so it compiles -Wall (except for sccsid's and copyright). This included fixing several printf formats that where not correct, and changing the data types of a few things. 3. Implement new option -i that produces indented mtree output files. 4. Implement new option -n that turns off directory comments. 5. Only emit /set records if something has changed since the last one.
Diffstat (limited to 'usr.sbin/mtree/compare.c')
-rw-r--r--usr.sbin/mtree/compare.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/usr.sbin/mtree/compare.c b/usr.sbin/mtree/compare.c
index b258572..166fb5b 100644
--- a/usr.sbin/mtree/compare.c
+++ b/usr.sbin/mtree/compare.c
@@ -59,7 +59,7 @@ static char *ftype __P((u_int));
(void)printf("\n"); \
} else { \
tab = ""; \
- (void)printf("%*s", INDENTNAMELEN - len, ""); \
+ (void)printf("%*s", INDENTNAMELEN - (int)len, ""); \
} \
}
@@ -72,7 +72,7 @@ compare(name, s, p)
extern int uflag;
u_long len, val;
int fd, label;
- char *cp, *tab;
+ char *cp, *tab = "";
label = 0;
switch(s->type) {
@@ -111,7 +111,7 @@ typeerr: LABEL;
/* Set the uid/gid first, then set the mode. */
if (s->flags & (F_UID | F_UNAME) && s->st_uid != p->fts_statp->st_uid) {
LABEL;
- (void)printf("%suser (%u, %u",
+ (void)printf("%suser (%lu, %lu",
tab, s->st_uid, p->fts_statp->st_uid);
if (uflag)
if (chown(p->fts_accpath, s->st_uid, -1))
@@ -125,7 +125,7 @@ typeerr: LABEL;
}
if (s->flags & (F_GID | F_GNAME) && s->st_gid != p->fts_statp->st_gid) {
LABEL;
- (void)printf("%sgid (%u, %u",
+ (void)printf("%sgid (%lu, %lu",
tab, s->st_gid, p->fts_statp->st_gid);
if (uflag)
if (chown(p->fts_accpath, -1, s->st_gid))
@@ -169,9 +169,9 @@ typeerr: LABEL;
* XXX
* 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) {
+ 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)) {
LABEL;
(void)printf("%smodification time (%.24s, ",
tab, ctime(&s->st_mtimespec.ts_sec));
OpenPOWER on IntegriCloud