summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilippe Charnier <charnier@FreeBSD.org>1998-06-08 06:44:05 +0000
committerPhilippe Charnier <charnier@FreeBSD.org>1998-06-08 06:44:05 +0000
commit65b4c10030ae2e08e461e1fc8b31915fd03e5ee8 (patch)
treec0af9b2fd95fe94151d52d8f36af1b90b9ba0ad1
parent59fde8c360d828745b740b76b2b3a03eb0a005db (diff)
Notes
-rw-r--r--sbin/dset/dset.c44
1 files changed, 22 insertions, 22 deletions
diff --git a/sbin/dset/dset.c b/sbin/dset/dset.c
index 2428289bcc18..7a1c58d4a78c 100644
--- a/sbin/dset/dset.c
+++ b/sbin/dset/dset.c
@@ -13,21 +13,23 @@
* Device configuration to kernel image saving utility.
*/
-#include <stdio.h>
-#include <nlist.h>
-#include <paths.h>
-#include <unistd.h>
+#ifndef lint
+static const char rcsid[] =
+ "$Id$";
+#endif /* not lint */
+
+#include <err.h>
#include <fcntl.h>
-#include <a.out.h>
#include <kvm.h>
+#include <a.out.h>
#include <limits.h>
+#include <paths.h>
+#include <stdio.h>
+#include <string.h>
#include <unistd.h>
-#include <stdlib.h>
#include <sys/stat.h>
#include <sys/types.h>
-#include <sys/uio.h>
#include <sys/param.h>
-#include <machine/param.h>
#include "i386/isa/isa_device.h"
#include "i386/isa/pnp.h"
@@ -37,8 +39,6 @@ struct pnp_cinfo old_ov[MAX_PNP_LDN];
#define TRUE 1
#define FALSE 0
-extern int errno;
-
struct nlist nl[] = {
#define N_TABTTY 0
{"_isa_devtab_tty"},
@@ -48,13 +48,13 @@ struct nlist nl[] = {
{"_isa_devtab_net"},
#define N_TABNULL 3
{"_isa_devtab_null"},
- "",
+ {""},
};
#define N_TABLAST N_TABNULL
struct nlist nlk[] = {
{"_isa_devlist"},
- "",
+ {""},
};
struct nlist nlaux[] = {
@@ -81,10 +81,9 @@ fatal(name, str)
if (quiet)
exit(1);
if (str)
- fprintf(stderr, "%s : %s\n", name, str);
+ errx(1, "%s: %s", name, str);
else
- perror(name);
- exit(1);
+ errx(1, "%s", name);
}
void
@@ -94,17 +93,19 @@ error(name, str)
if (quiet)
return;
if (str)
- fprintf(stderr, "%s : %s\n", name, str);
+ warnx("%s: %s", name, str);
else
- perror(name);
+ warnx("%s", name);
}
void
-usage(char *title)
+usage()
{
- fprintf(stderr, "usage: %s [-qtv]\n", title);
+ fprintf(stderr, "usage: dset [-qtv]\n");
+ exit(1);
}
+int
main(ac, av)
int ac;
char **av;
@@ -123,7 +124,6 @@ main(ac, av)
static char errb[_POSIX2_LINE_MAX];
const char *kernel = NULL;
- extern char *optarg;
char ch;
int testonly = FALSE;
int verbose = FALSE;
@@ -143,8 +143,7 @@ main(ac, av)
case '?':
default:
- usage(av[0]);
- exit(1);
+ usage();
}
@@ -428,4 +427,5 @@ main(ac, av)
kvm_close(kd);
close(f);
+ return(0);
}