summaryrefslogtreecommitdiffstats
path: root/usr.sbin/mtree/misc.c
diff options
context:
space:
mode:
authorjoe <joe@FreeBSD.org>2000-06-17 14:19:33 +0000
committerjoe <joe@FreeBSD.org>2000-06-17 14:19:33 +0000
commit8de98cc2fa7b119cc8deb33c61c9496d25825b49 (patch)
tree33363d4028bb162e624a3a2c5257ab020378f6e0 /usr.sbin/mtree/misc.c
parent3e8b2c512359fd536c5f66fbd9e265064d461886 (diff)
downloadFreeBSD-src-8de98cc2fa7b119cc8deb33c61c9496d25825b49.zip
FreeBSD-src-8de98cc2fa7b119cc8deb33c61c9496d25825b49.tar.gz
Switch over to using the new fflagstostr and strtofflags library calls.
Diffstat (limited to 'usr.sbin/mtree/misc.c')
-rw-r--r--usr.sbin/mtree/misc.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/usr.sbin/mtree/misc.c b/usr.sbin/mtree/misc.c
index ea413dd..7721ff4 100644
--- a/usr.sbin/mtree/misc.c
+++ b/usr.sbin/mtree/misc.c
@@ -44,6 +44,7 @@ static const char rcsid[] =
#include <err.h>
#include <fts.h>
#include <stdio.h>
+#include <unistd.h>
#include "mtree.h"
#include "extern.h"
@@ -109,3 +110,20 @@ keycompare(a, b)
{
return (strcmp(((KEY *)a)->name, ((KEY *)b)->name));
}
+
+char *
+flags_to_string(fflags)
+ u_long fflags;
+{
+ char *string;
+
+ string = fflagstostr(fflags);
+ if (string != NULL && *string == '\0') {
+ free(string);
+ string = strdup("none");
+ }
+ if (string == NULL)
+ err(1, NULL);
+
+ return string;
+}
OpenPOWER on IntegriCloud