summaryrefslogtreecommitdiffstats
path: root/sbin
diff options
context:
space:
mode:
authorcharnier <charnier@FreeBSD.org>1998-06-08 06:41:47 +0000
committercharnier <charnier@FreeBSD.org>1998-06-08 06:41:47 +0000
commit3aaa3dc7932f1fc977ac49897bcf9e5a5872162c (patch)
tree37dde9cd49c9973a0758677484c9ad33a86007a2 /sbin
parent3ee711b2cbab48c5cf7ad3506a90b754eef8ff9e (diff)
downloadFreeBSD-src-3aaa3dc7932f1fc977ac49897bcf9e5a5872162c.zip
FreeBSD-src-3aaa3dc7932f1fc977ac49897bcf9e5a5872162c.tar.gz
Use warnx()+fprintf() to handle multi-line messages. Correct K&R support and
KNF continuation indent rule. Requested by: Bruce.
Diffstat (limited to 'sbin')
-rw-r--r--sbin/bsdlabel/bsdlabel.c22
-rw-r--r--sbin/disklabel/disklabel.c22
2 files changed, 20 insertions, 24 deletions
diff --git a/sbin/bsdlabel/bsdlabel.c b/sbin/bsdlabel/bsdlabel.c
index 1d9273f..4bd1ea4 100644
--- a/sbin/bsdlabel/bsdlabel.c
+++ b/sbin/bsdlabel/bsdlabel.c
@@ -46,7 +46,7 @@ static char sccsid[] = "@(#)disklabel.c 8.2 (Berkeley) 1/7/94";
/* from static char sccsid[] = "@(#)disklabel.c 1.2 (Symmetric) 11/28/85"; */
#endif
static const char rcsid[] =
- "$Id$";
+ "$Id: disklabel.c,v 1.13 1998/06/04 06:49:13 charnier Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -248,9 +248,6 @@ main(argc, argv)
switch(op) {
- case UNSPEC:
- break;
-
case EDIT:
if (argc != 1)
usage();
@@ -460,13 +457,14 @@ l_perror(s)
switch (errno) {
case ESRCH:
- warnx("%s: no disk label on disk;\n"
- "use \"disklabel -r\" to install initial label", s);
+ warnx("%s: no disk label on disk;", s);
+ fprintf(stderr,
+ "use \"disklabel -r\" to install initial label\n");
break;
case EINVAL:
- warnx("%s: label magic number or checksum is wrong!\n"
- "(disklabel or kernel is out of date?)", s);
+ warnx("%s: label magic number or checksum is wrong!", s);
+ fprintf(stderr, "(disklabel or kernel is out of date?)\n");
break;
case EBUSY:
@@ -475,7 +473,7 @@ l_perror(s)
case EXDEV:
warnx(
- "%s: labeled partition or 'a' partition must start at beginning of disk", s);
+ "%s: labeled partition or 'a' partition must start at beginning of disk", s);
break;
default:
@@ -505,9 +503,9 @@ readlabel(f)
break;
if (lp > (struct disklabel *)(bootarea+BBSIZE-sizeof(*lp)) ||
lp->d_magic != DISKMAGIC || lp->d_magic2 != DISKMAGIC ||
- dkcksum(lp) != 0) {
- errx(1, "bad pack magic number (label is damaged, or pack is unlabeled)");
- }
+ dkcksum(lp) != 0)
+ errx(1,
+ "bad pack magic number (label is damaged, or pack is unlabeled)");
} else {
lp = &lab;
if (ioctl(f, DIOCGDINFO, lp) < 0)
diff --git a/sbin/disklabel/disklabel.c b/sbin/disklabel/disklabel.c
index 1d9273f..4bd1ea4 100644
--- a/sbin/disklabel/disklabel.c
+++ b/sbin/disklabel/disklabel.c
@@ -46,7 +46,7 @@ static char sccsid[] = "@(#)disklabel.c 8.2 (Berkeley) 1/7/94";
/* from static char sccsid[] = "@(#)disklabel.c 1.2 (Symmetric) 11/28/85"; */
#endif
static const char rcsid[] =
- "$Id$";
+ "$Id: disklabel.c,v 1.13 1998/06/04 06:49:13 charnier Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -248,9 +248,6 @@ main(argc, argv)
switch(op) {
- case UNSPEC:
- break;
-
case EDIT:
if (argc != 1)
usage();
@@ -460,13 +457,14 @@ l_perror(s)
switch (errno) {
case ESRCH:
- warnx("%s: no disk label on disk;\n"
- "use \"disklabel -r\" to install initial label", s);
+ warnx("%s: no disk label on disk;", s);
+ fprintf(stderr,
+ "use \"disklabel -r\" to install initial label\n");
break;
case EINVAL:
- warnx("%s: label magic number or checksum is wrong!\n"
- "(disklabel or kernel is out of date?)", s);
+ warnx("%s: label magic number or checksum is wrong!", s);
+ fprintf(stderr, "(disklabel or kernel is out of date?)\n");
break;
case EBUSY:
@@ -475,7 +473,7 @@ l_perror(s)
case EXDEV:
warnx(
- "%s: labeled partition or 'a' partition must start at beginning of disk", s);
+ "%s: labeled partition or 'a' partition must start at beginning of disk", s);
break;
default:
@@ -505,9 +503,9 @@ readlabel(f)
break;
if (lp > (struct disklabel *)(bootarea+BBSIZE-sizeof(*lp)) ||
lp->d_magic != DISKMAGIC || lp->d_magic2 != DISKMAGIC ||
- dkcksum(lp) != 0) {
- errx(1, "bad pack magic number (label is damaged, or pack is unlabeled)");
- }
+ dkcksum(lp) != 0)
+ errx(1,
+ "bad pack magic number (label is damaged, or pack is unlabeled)");
} else {
lp = &lab;
if (ioctl(f, DIOCGDINFO, lp) < 0)
OpenPOWER on IntegriCloud