summaryrefslogtreecommitdiffstats
path: root/usr.bin/cap_mkdb
diff options
context:
space:
mode:
authorcharnier <charnier@FreeBSD.org>1999-11-21 16:16:30 +0000
committercharnier <charnier@FreeBSD.org>1999-11-21 16:16:30 +0000
commitf3267b7b85e46107842897cebb8fbe25d80bb556 (patch)
tree3d4939794e5d57c22d3bc37126a60e88ccfbedfb /usr.bin/cap_mkdb
parentd09776075b30af9572566b18a6ec882ff363cc32 (diff)
downloadFreeBSD-src-f3267b7b85e46107842897cebb8fbe25d80bb556.zip
FreeBSD-src-f3267b7b85e46107842897cebb8fbe25d80bb556.tar.gz
Make better use of .Ar. Use DIAGNOSTICS instead of incorrect section name.
Add rcsid. Remove unused #includes. Cosmetic in error messages.
Diffstat (limited to 'usr.bin/cap_mkdb')
-rw-r--r--usr.bin/cap_mkdb/cap_mkdb.118
-rw-r--r--usr.bin/cap_mkdb/cap_mkdb.c16
2 files changed, 17 insertions, 17 deletions
diff --git a/usr.bin/cap_mkdb/cap_mkdb.1 b/usr.bin/cap_mkdb/cap_mkdb.1
index 4cd9ab2..ad4846a 100644
--- a/usr.bin/cap_mkdb/cap_mkdb.1
+++ b/usr.bin/cap_mkdb/cap_mkdb.1
@@ -38,20 +38,18 @@
.Sh NAME
.Nm cap_mkdb
.Nd create capability database
-.Pp
.Sh SYNOPSIS
.Nm cap_mkdb
.Op Fl v
.Op Fl f Ar outfile
-.Ar file1
-.Op Ar file2 ...
-.Pp
+.Ar file
+.Op Ar
.Sh DESCRIPTION
.Nm Cap_mkdb
builds a hashed database out of the
.Xr getcap 3
logical database constructed by the concatenation of the specified
-files .
+files.
.Pp
The database is named by the basename of the first file argument and
the string
@@ -64,8 +62,8 @@ than they can the original text file(s).
The ``tc'' capabilities of the records are expanded before the
record is stored into the database.
.Pp
-The options as follows:
-.Bl -tag -width XXXXXX -indent
+The following options are available:
+.Bl -tag -width indent
.It Fl f Ar outfile
Specify a different database basename.
.It Fl v
@@ -92,10 +90,10 @@ in a key/data pair of the second type.
The data field of this key/data pair is used to look up a key/data
pair of the first type which has the real data associated with the
name.
-.Sh RETURN VALUE
+.Sh DIAGNOSTICS
The
-.Nm cap_mkdb
-utility exits 0 on success and >0 if an error occurs.
+.Nm
+utility exits 0 on success, and >0 if an error occurs.
.Sh SEE ALSO
.Xr dbopen 3 ,
.Xr getcap 3 ,
diff --git a/usr.bin/cap_mkdb/cap_mkdb.c b/usr.bin/cap_mkdb/cap_mkdb.c
index f28d8db..ccd5d3b 100644
--- a/usr.bin/cap_mkdb/cap_mkdb.c
+++ b/usr.bin/cap_mkdb/cap_mkdb.c
@@ -38,7 +38,11 @@ static const char copyright[] =
#endif /* not lint */
#ifndef lint
-static const char sccsid[] = "@(#)cap_mkdb.c 8.1 (Berkeley) 6/6/93";
+#if 0
+static char sccsid[] = "@(#)cap_mkdb.c 8.1 (Berkeley) 6/6/93";
+#endif
+static const char rcsid[] =
+ "$FreeBSD$";
#endif /* not lint */
#include <sys/param.h>
@@ -46,9 +50,7 @@ static const char sccsid[] = "@(#)cap_mkdb.c 8.1 (Berkeley) 6/6/93";
#include <db.h>
#include <err.h>
-#include <errno.h>
#include <fcntl.h>
-#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -102,7 +104,7 @@ main(argc, argv)
*/
(void)snprintf(buf, sizeof(buf), "%s.db", capname ? capname : *argv);
if ((capname = strdup(buf)) == NULL)
- err(1, (char *)NULL);
+ errx(1, "strdup failed");
if ((capdbp = dbopen(capname,
O_CREAT | O_TRUNC | O_RDWR, DEFFILEMODE, DB_HASH, NULL)) == NULL)
err(1, "%s", buf);
@@ -159,7 +161,7 @@ db_build(ifiles)
if (bplen <= len + 2) {
bplen += MAX(256, len + 2);
if ((data.data = realloc(data.data, bplen)) == NULL)
- err(1, (char *)NULL);
+ errx(1, "malloc failed");
}
/* Find the end of the name field. */
@@ -175,7 +177,7 @@ db_build(ifiles)
break;
case 2:
((char *)(data.data))[0] = TCERR;
- warnx("Record not tc expanded: %.*s", p - bp, bp);
+ warnx("record not tc expanded: %.*s", p - bp, bp);
break;
}
@@ -245,6 +247,6 @@ void
usage()
{
(void)fprintf(stderr,
- "usage: cap_mkdb [-v] [-f outfile] file1 [file2 ...]\n");
+ "usage: cap_mkdb [-v] [-f outfile] file [file ...]\n");
exit(1);
}
OpenPOWER on IntegriCloud