summaryrefslogtreecommitdiffstats
path: root/usr.sbin/mtree
diff options
context:
space:
mode:
authorjoe <joe@FreeBSD.org>2000-01-27 21:17:01 +0000
committerjoe <joe@FreeBSD.org>2000-01-27 21:17:01 +0000
commitf1a9497df5db81a71987fa20f10c831030987e36 (patch)
treebcca8d67d721cd7e4ca8e7322d19df89912cfd26 /usr.sbin/mtree
parent30f3b614b3b18d86be7ff164b9aba2617637b9c6 (diff)
downloadFreeBSD-src-f1a9497df5db81a71987fa20f10c831030987e36.zip
FreeBSD-src-f1a9497df5db81a71987fa20f10c831030987e36.tar.gz
Historically file flags (schg, uschg, etc) have been converted from
string to u_long and back using two functions, flags_to_string and string_to_flags, which co-existed with 'ls'. As time has progressed more and more other tools have used these private functions to manipulate the file flags. Recently I moved these functions from /usr/src/bin/ls to libutil, but after some discussion with bde it's been decided that they really ought to go in libc. There are two already existing libc functions for manipulating file modes: setmode and getmode. In keeping with these flags_to_string has been renamed getflags and string_to_flags to setflags. The manual page could probably be improved upon ;)
Diffstat (limited to 'usr.sbin/mtree')
-rw-r--r--usr.sbin/mtree/Makefile2
-rw-r--r--usr.sbin/mtree/compare.c4
-rw-r--r--usr.sbin/mtree/create.c4
-rw-r--r--usr.sbin/mtree/spec.c2
4 files changed, 5 insertions, 7 deletions
diff --git a/usr.sbin/mtree/Makefile b/usr.sbin/mtree/Makefile
index cc0b261..6a5d615 100644
--- a/usr.sbin/mtree/Makefile
+++ b/usr.sbin/mtree/Makefile
@@ -4,8 +4,6 @@
PROG= mtree
SRCS= compare.c crc.c create.c misc.c mtree.c spec.c verify.c
MAN8= mtree.8
-DPADD= ${LIBUTIL}
-LDADD= -lutil
.PATH: ${.CURDIR}/../../usr.bin/cksum
.if !defined(WORLD)
diff --git a/usr.sbin/mtree/compare.c b/usr.sbin/mtree/compare.c
index 9f2db9f..007edb7 100644
--- a/usr.sbin/mtree/compare.c
+++ b/usr.sbin/mtree/compare.c
@@ -225,9 +225,9 @@ typeerr: LABEL;
if ((s->flags & F_FLAGS) && s->st_flags != p->fts_statp->st_flags) {
LABEL;
(void)printf("%sflags (\"%s\" is not ", tab,
- flags_to_string(s->st_flags, "none"));
+ getflags(s->st_flags, "none"));
(void)printf("\"%s\"",
- flags_to_string(p->fts_statp->st_flags, "none"));
+ getflags(p->fts_statp->st_flags, "none"));
if (uflag)
if (chflags(p->fts_accpath, s->st_flags))
(void)printf(", not modified: %s)\n",
diff --git a/usr.sbin/mtree/create.c b/usr.sbin/mtree/create.c
index 72049f4..0146bd2 100644
--- a/usr.sbin/mtree/create.c
+++ b/usr.sbin/mtree/create.c
@@ -254,7 +254,7 @@ statf(indent, p)
output(indent, &offset, "link=%s", rlink(p->fts_accpath));
if (keys & F_FLAGS && p->fts_statp->st_flags != flags)
output(indent, &offset, "flags=%s",
- flags_to_string(p->fts_statp->st_flags, "none"));
+ getflags(p->fts_statp->st_flags, "none"));
(void)putchar('\n');
}
@@ -372,7 +372,7 @@ statd(t, parent, puid, pgid, pmode, pflags)
(void)printf(" nlink=1");
if (keys & F_FLAGS && saveflags)
(void)printf(" flags=%s",
- flags_to_string(saveflags, "none"));
+ getflags(saveflags, "none"));
(void)printf("\n");
*puid = saveuid;
*pgid = savegid;
diff --git a/usr.sbin/mtree/spec.c b/usr.sbin/mtree/spec.c
index 3fa9e7c..10c3704 100644
--- a/usr.sbin/mtree/spec.c
+++ b/usr.sbin/mtree/spec.c
@@ -214,7 +214,7 @@ set(t, ip)
case F_FLAGS:
if (strcmp("none", val) == 0)
ip->st_flags = 0;
- else if (string_to_flags(&val, &ip->st_flags,NULL) != 0)
+ else if (setflags(&val, &ip->st_flags, NULL) != 0)
errx(1, "line %d: invalid flag %s",lineno, val);
break;
case F_GID:
OpenPOWER on IntegriCloud