Module Name:    src
Committed By:   christos
Date:           Tue Jun 16 23:18:55 UTC 2015

Modified Files:
        src/sbin/cgdconfig: params.c
        src/sbin/dmctl: dmctl.c
        src/sbin/fdisk: fdisk.c
        src/sbin/fsck_ffs: main.c
        src/sbin/fsck_lfs: inode.c main.c pass2.c pass4.c segwrite.c
            utilities.c
        src/sbin/fsck_msdos: main.c
        src/sbin/gpt: restore.c
        src/sbin/init: init.c
        src/sbin/newfs: mkfs.c
        src/sbin/newfs_ext2fs: mke2fs.c
        src/sbin/newfs_udf: udf_create.c
        src/sbin/newfs_v7fs: newfs_v7fs.c
        src/sbin/veriexecctl: veriexecctl.c

Log Message:
fix error messages containing \n


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sbin/cgdconfig/params.c
cvs rdiff -u -r1.4 -r1.5 src/sbin/dmctl/dmctl.c
cvs rdiff -u -r1.150 -r1.151 src/sbin/fdisk/fdisk.c
cvs rdiff -u -r1.81 -r1.82 src/sbin/fsck_ffs/main.c
cvs rdiff -u -r1.53 -r1.54 src/sbin/fsck_lfs/inode.c
cvs rdiff -u -r1.48 -r1.49 src/sbin/fsck_lfs/main.c
cvs rdiff -u -r1.23 -r1.24 src/sbin/fsck_lfs/pass2.c
cvs rdiff -u -r1.22 -r1.23 src/sbin/fsck_lfs/pass4.c
cvs rdiff -u -r1.29 -r1.30 src/sbin/fsck_lfs/segwrite.c
cvs rdiff -u -r1.35 -r1.36 src/sbin/fsck_lfs/utilities.c
cvs rdiff -u -r1.23 -r1.24 src/sbin/fsck_msdos/main.c
cvs rdiff -u -r1.7 -r1.8 src/sbin/gpt/restore.c
cvs rdiff -u -r1.105 -r1.106 src/sbin/init/init.c
cvs rdiff -u -r1.124 -r1.125 src/sbin/newfs/mkfs.c
cvs rdiff -u -r1.21 -r1.22 src/sbin/newfs_ext2fs/mke2fs.c
cvs rdiff -u -r1.24 -r1.25 src/sbin/newfs_udf/udf_create.c
cvs rdiff -u -r1.3 -r1.4 src/sbin/newfs_v7fs/newfs_v7fs.c
cvs rdiff -u -r1.38 -r1.39 src/sbin/veriexecctl/veriexecctl.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sbin/cgdconfig/params.c
diff -u src/sbin/cgdconfig/params.c:1.25 src/sbin/cgdconfig/params.c:1.26
--- src/sbin/cgdconfig/params.c:1.25	Sun Dec 14 07:31:39 2014
+++ src/sbin/cgdconfig/params.c	Tue Jun 16 19:18:54 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: params.c,v 1.25 2014/12/14 12:31:39 mlelstv Exp $ */
+/* $NetBSD: params.c,v 1.26 2015/06/16 23:18:54 christos Exp $ */
 
 /*-
  * Copyright (c) 2002, 2003 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: params.c,v 1.25 2014/12/14 12:31:39 mlelstv Exp $");
+__RCSID("$NetBSD: params.c,v 1.26 2015/06/16 23:18:54 christos Exp $");
 #endif
 
 #include <sys/types.h>
@@ -277,7 +277,7 @@ params_verify_method(string_t *in)
 
 	if (p->verify_method == VERIFY_UNKNOWN)
 		warnx("params_setverify_method: unrecognized "
-		    "verify method \"%s\"\n", vm);
+		    "verify method \"%s\"", vm);
 	return p;
 }
 
@@ -515,7 +515,7 @@ keygen_method(string_t *in)
 	string_free(in);
 
 	if (kg->kg_method == KEYGEN_UNKNOWN)
-		warnx("unrecognized key generation method \"%s\"\n", kgm);
+		warnx("unrecognized key generation method \"%s\"", kgm);
 	return kg;
 }
 

Index: src/sbin/dmctl/dmctl.c
diff -u src/sbin/dmctl/dmctl.c:1.4 src/sbin/dmctl/dmctl.c:1.5
--- src/sbin/dmctl/dmctl.c:1.4	Fri Oct 18 21:09:58 2013
+++ src/sbin/dmctl/dmctl.c	Tue Jun 16 19:18:54 2015
@@ -291,7 +291,7 @@ dmctl_get_device_info(int argc __unused,
 	libdm_task_set_name(dvname, task);
 
 	if (libdm_task_run(task) != 0)
-		err(EXIT_FAILURE, "dmctl_get_device_info: libdm_task_run failed.\n");
+		err(EXIT_FAILURE, "%s: libdm_task_run failed", __func__);
 
 	printf("Printing Device info for:\n");
 	printf("Device name: \t\t%s\n", libdm_task_get_name(task));
@@ -559,7 +559,7 @@ parse_stdin(char *file_path)
 
 	if (file_path) {
 		if ((fp = fopen(file_path, "r")) == NULL)
-			err(ENOENT, "Cannot open table file\n");
+			err(ENOENT, "Cannot open table file");
 	} else
 		fp = stdin;
 

Index: src/sbin/fdisk/fdisk.c
diff -u src/sbin/fdisk/fdisk.c:1.150 src/sbin/fdisk/fdisk.c:1.151
--- src/sbin/fdisk/fdisk.c:1.150	Fri Apr  4 12:15:30 2014
+++ src/sbin/fdisk/fdisk.c	Tue Jun 16 19:18:54 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: fdisk.c,v 1.150 2014/04/04 16:15:30 christos Exp $ */
+/*	$NetBSD: fdisk.c,v 1.151 2015/06/16 23:18:54 christos Exp $ */
 
 /*
  * Mach Operating System
@@ -39,7 +39,7 @@
 #include <sys/cdefs.h>
 
 #ifndef lint
-__RCSID("$NetBSD: fdisk.c,v 1.150 2014/04/04 16:15:30 christos Exp $");
+__RCSID("$NetBSD: fdisk.c,v 1.151 2015/06/16 23:18:54 christos Exp $");
 #endif /* not lint */
 
 #define MBRPTYPENAMES
@@ -2246,7 +2246,7 @@ change_part(int extended, int part, int 
 		errtext = check_overlap(part, sysid, start, size, 0);
 	if (errtext != NULL && !I_flag) {
 		if (f_flag)
-			errx(2, "%s\n", errtext);
+			errx(2, "%s", errtext);
 		printf("%s\n", errtext);
 		return 0;
 	}
@@ -2264,7 +2264,7 @@ change_part(int extended, int part, int 
 		else
 			errtext = check_overlap(part, sysid, start, size, 1);
 		if (errtext)
-			errx(1, "%s\n", errtext);
+			errx(1, "%s", errtext);
 	}
 
 

Index: src/sbin/fsck_ffs/main.c
diff -u src/sbin/fsck_ffs/main.c:1.81 src/sbin/fsck_ffs/main.c:1.82
--- src/sbin/fsck_ffs/main.c:1.81	Tue Jan 22 04:39:11 2013
+++ src/sbin/fsck_ffs/main.c	Tue Jun 16 19:18:55 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.81 2013/01/22 09:39:11 dholland Exp $	*/
+/*	$NetBSD: main.c,v 1.82 2015/06/16 23:18:55 christos Exp $	*/
 
 /*
  * Copyright (c) 1980, 1986, 1993
@@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 19
 #if 0
 static char sccsid[] = "@(#)main.c	8.6 (Berkeley) 5/14/95";
 #else
-__RCSID("$NetBSD: main.c,v 1.81 2013/01/22 09:39:11 dholland Exp $");
+__RCSID("$NetBSD: main.c,v 1.82 2015/06/16 23:18:55 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -188,7 +188,7 @@ main(int argc, char *argv[])
 
 	if (snap_backup || snap_internal) {
 		if (!nflag || yflag) {
-			warnx("Cannot use -x or -X without -n\n");
+			warnx("Cannot use -x or -X without -n");
 			snap_backup = NULL;
 			snap_internal = 0;
 		}

Index: src/sbin/fsck_lfs/inode.c
diff -u src/sbin/fsck_lfs/inode.c:1.53 src/sbin/fsck_lfs/inode.c:1.54
--- src/sbin/fsck_lfs/inode.c:1.53	Sun Mar 29 15:35:58 2015
+++ src/sbin/fsck_lfs/inode.c	Tue Jun 16 19:18:55 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: inode.c,v 1.53 2015/03/29 19:35:58 chopps Exp $	 */
+/* $NetBSD: inode.c,v 1.54 2015/06/16 23:18:55 christos Exp $	 */
 
 /*-
  * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@@ -396,7 +396,7 @@ getinoinfo(ino_t inumber)
 			continue;
 		return (inp);
 	}
-	err(EEXIT, "cannot find inode %llu\n", (unsigned long long)inumber);
+	err(EEXIT, "cannot find inode %llu", (unsigned long long)inumber);
 	return ((struct inoinfo *) 0);
 }
 
@@ -566,7 +566,7 @@ blkerror(ino_t ino, const char *type, da
 		return;
 
 	default:
-		err(EEXIT, "BAD STATE %d TO BLKERR\n", statemap[ino]);
+		err(EEXIT, "BAD STATE %d TO BLKERR", statemap[ino]);
 		/* NOTREACHED */
 	}
 }

Index: src/sbin/fsck_lfs/main.c
diff -u src/sbin/fsck_lfs/main.c:1.48 src/sbin/fsck_lfs/main.c:1.49
--- src/sbin/fsck_lfs/main.c:1.48	Sat Jul 12 22:44:21 2014
+++ src/sbin/fsck_lfs/main.c	Tue Jun 16 19:18:55 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: main.c,v 1.48 2014/07/13 02:44:21 dholland Exp $	 */
+/* $NetBSD: main.c,v 1.49 2015/06/16 23:18:55 christos Exp $	 */
 
 /*
  * Copyright (c) 1980, 1986, 1993
@@ -106,7 +106,7 @@ main(int argc, char **argv)
 		case 'm':
 			lfmode = argtoi('m', "mode", optarg, 8);
 			if (lfmode & ~07777)
-				err(1, "bad mode to -m: %o\n", lfmode);
+				err(1, "bad mode to -m: %o", lfmode);
 			printf("** lost+found creation mode %o\n", lfmode);
 			break;
 
@@ -191,7 +191,7 @@ argtoi(int flag, const char *req, const 
 
 	ret = (int) strtol(str, &cp, base);
 	if (cp == str || *cp)
-		err(FSCK_EXIT_USAGE, "-%c flag requires a %s\n", flag, req);
+		err(FSCK_EXIT_USAGE, "-%c flag requires a %s", flag, req);
 	return (ret);
 }
 

Index: src/sbin/fsck_lfs/pass2.c
diff -u src/sbin/fsck_lfs/pass2.c:1.23 src/sbin/fsck_lfs/pass2.c:1.24
--- src/sbin/fsck_lfs/pass2.c:1.23	Fri Jun  7 22:16:03 2013
+++ src/sbin/fsck_lfs/pass2.c	Tue Jun 16 19:18:55 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: pass2.c,v 1.23 2013/06/08 02:16:03 dholland Exp $	 */
+/* $NetBSD: pass2.c,v 1.24 2015/06/16 23:18:55 christos Exp $	 */
 
 /*
  * Copyright (c) 1980, 1986, 1993
@@ -82,7 +82,7 @@ pass2(void)
 		if (reply("REALLOCATE")) {
 			freeino(ULFS_ROOTINO);
 			if (allocdir(ULFS_ROOTINO, ULFS_ROOTINO, 0755) != ULFS_ROOTINO)
-				err(EEXIT, "CANNOT ALLOCATE ROOT INODE\n");
+				err(EEXIT, "CANNOT ALLOCATE ROOT INODE");
 			break;
 		}
 		if (reply("CONTINUE") == 0)
@@ -95,7 +95,7 @@ pass2(void)
 		if (reply("REALLOCATE")) {
 			freeino(ULFS_ROOTINO);
 			if (allocdir(ULFS_ROOTINO, ULFS_ROOTINO, 0755) != ULFS_ROOTINO)
-				err(EEXIT, "CANNOT ALLOCATE ROOT INODE\n");
+				err(EEXIT, "CANNOT ALLOCATE ROOT INODE");
 			break;
 		}
 		if (reply("FIX") == 0)
@@ -111,7 +111,7 @@ pass2(void)
 		break;
 
 	default:
-		errx(EEXIT, "BAD STATE %d FOR ROOT INODE\n", statemap[ULFS_ROOTINO]);
+		errx(EEXIT, "BAD STATE %d FOR ROOT INODE", statemap[ULFS_ROOTINO]);
 	}
 	statemap[ULFS_WINO] = FSTATE;
 	typemap[ULFS_WINO] = LFS_DT_WHT;

Index: src/sbin/fsck_lfs/pass4.c
diff -u src/sbin/fsck_lfs/pass4.c:1.22 src/sbin/fsck_lfs/pass4.c:1.23
--- src/sbin/fsck_lfs/pass4.c:1.22	Tue Jun 18 14:18:58 2013
+++ src/sbin/fsck_lfs/pass4.c	Tue Jun 16 19:18:55 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: pass4.c,v 1.22 2013/06/18 18:18:58 christos Exp $	 */
+/* $NetBSD: pass4.c,v 1.23 2015/06/16 23:18:55 christos Exp $	 */
 
 /*
  * Copyright (c) 1980, 1986, 1993
@@ -137,7 +137,7 @@ pass4(void)
 			break;
 
 		default:
-			err(EEXIT, "BAD STATE %d FOR INODE I=%llu\n",
+			err(EEXIT, "BAD STATE %d FOR INODE I=%llu",
 			    statemap[inumber], (unsigned long long)inumber);
 		}
 	}

Index: src/sbin/fsck_lfs/segwrite.c
diff -u src/sbin/fsck_lfs/segwrite.c:1.29 src/sbin/fsck_lfs/segwrite.c:1.30
--- src/sbin/fsck_lfs/segwrite.c:1.29	Sun May 31 11:44:30 2015
+++ src/sbin/fsck_lfs/segwrite.c	Tue Jun 16 19:18:55 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: segwrite.c,v 1.29 2015/05/31 15:44:30 hannken Exp $ */
+/* $NetBSD: segwrite.c,v 1.30 2015/06/16 23:18:55 christos Exp $ */
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -447,7 +447,8 @@ lfs_update_single(struct lfs * fs, struc
 
 	error = ulfs_bmaparray(fs, vp, lbn, &daddr, a, &num);
 	if (error)
-		errx(1, "lfs_updatemeta: ulfs_bmaparray returned %d looking up lbn %" PRId64 "\n", error, lbn);
+		errx(EXIT_FAILURE, "%s: ulfs_bmaparray returned %d looking up lbn %"
+		    PRId64 "", __func__, error, lbn);
 	if (daddr > 0)
 		daddr = LFS_DBTOFSB(fs, daddr);
 
@@ -473,7 +474,7 @@ lfs_update_single(struct lfs * fs, struc
 	default:
 		ap = &a[num - 1];
 		if (bread(vp, ap->in_lbn, fs->lfs_bsize, 0, &bp))
-			errx(1, "lfs_updatemeta: bread bno %" PRId64,
+			errx(EXIT_FAILURE, "%s: bread bno %" PRId64, __func__,
 			    ap->in_lbn);
 
 		ooff = ((ulfs_daddr_t *) bp->b_data)[ap->in_off];
@@ -576,7 +577,7 @@ lfs_updatemeta(struct segment * sp)
 		 * is of a smaller size!)
 		 */
 		if ((sbp->b_bcount & fs->lfs_bmask) && i != 0)
-			errx(1, "lfs_updatemeta: fragment is not last block");
+			errx(EXIT_FAILURE, "%s: fragment is not last block", __func__);
 
 		/*
 		 * For each subblock in this possibly oversized block,
@@ -709,7 +710,7 @@ lfs_newseg(struct lfs * fs)
 	for (sn = curseg = lfs_dtosn(fs, fs->lfs_curseg) + fs->lfs_interleave;;) {
 		sn = (sn + 1) % fs->lfs_nseg;
 		if (sn == curseg)
-			errx(1, "lfs_nextseg: no clean segments");
+			errx(EXIT_FAILURE, "%s: no clean segments", __func__);
 		LFS_SEGENTRY(sup, fs, sn, bp);
 		isdirty = sup->su_flags & SEGUSE_DIRTY;
 		brelse(bp, 0);
@@ -823,7 +824,7 @@ lfs_writeseg(struct lfs * fs, struct seg
 	    lfs_btofsb(fs, fs->lfs_sumsize));
 
 	if (devvp == NULL)
-		errx(1, "devvp is NULL");
+		errx(EXIT_FAILURE, "devvp is NULL");
 	for (bpp = sp->bpp, i = nblocks; i; bpp++, i--) {
 		bp = *bpp;
 #if 0
@@ -903,9 +904,8 @@ lfs_seglock(struct lfs * fs, unsigned lo
 	sp = fs->lfs_sp = emalloc(sizeof(*sp));
 	sp->bpp = emalloc(fs->lfs_ssize * sizeof(struct ubuf *));
 	if (!sp->bpp)
-		errx(!preen, "Could not allocate %zu bytes: %s",
-			(size_t)(fs->lfs_ssize * sizeof(struct ubuf *)),
-			strerror(errno));
+		err(!preen, "Could not allocate %zu bytes",
+		    (size_t)(fs->lfs_ssize * sizeof(struct ubuf *)))
 	sp->seg_flags = flags;
 	sp->vp = NULL;
 	sp->seg_iocount = 0;
@@ -954,7 +954,7 @@ lfs_segunlock(struct lfs * fs)
 		--fs->lfs_seglock;
 		fs->lfs_lockpid = 0;
 	} else if (fs->lfs_seglock == 0) {
-		errx(1, "Seglock not held");
+		errx(EXIT_FAILURE, "Seglock not held");
 	} else {
 		--fs->lfs_seglock;
 	}

Index: src/sbin/fsck_lfs/utilities.c
diff -u src/sbin/fsck_lfs/utilities.c:1.35 src/sbin/fsck_lfs/utilities.c:1.36
--- src/sbin/fsck_lfs/utilities.c:1.35	Fri Jun  7 22:16:03 2013
+++ src/sbin/fsck_lfs/utilities.c	Tue Jun 16 19:18:55 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: utilities.c,v 1.35 2013/06/08 02:16:03 dholland Exp $	 */
+/* $NetBSD: utilities.c,v 1.36 2015/06/16 23:18:55 christos Exp $	 */
 
 /*
  * Copyright (c) 1980, 1986, 1993
@@ -89,7 +89,7 @@ reply(const char *question)
 	char c;
 
 	if (preen)
-		err(1, "INTERNAL ERROR: GOT TO reply()");
+		err(EXIT_FAILURE, "INTERNAL ERROR: GOT TO reply()");
 	persevere = !strcmp(question, "CONTINUE");
 	pwarn("\n");
 	if (!persevere && nflag) {

Index: src/sbin/fsck_msdos/main.c
diff -u src/sbin/fsck_msdos/main.c:1.23 src/sbin/fsck_msdos/main.c:1.24
--- src/sbin/fsck_msdos/main.c:1.23	Thu Jun  9 17:23:29 2011
+++ src/sbin/fsck_msdos/main.c	Tue Jun 16 19:18:55 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.23 2011/06/09 21:23:29 christos Exp $	*/
+/*	$NetBSD: main.c,v 1.24 2015/06/16 23:18:55 christos Exp $	*/
 
 /*
  * Copyright (C) 1995 Wolfgang Solfrank
@@ -28,7 +28,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: main.c,v 1.23 2011/06/09 21:23:29 christos Exp $");
+__RCSID("$NetBSD: main.c,v 1.24 2015/06/16 23:18:55 christos Exp $");
 #endif /* not lint */
 
 #include <stdlib.h>
@@ -106,7 +106,7 @@ main(int argc, char **argv)
 		}
 	}
 	if (snap_backup != NULL && (!alwaysno || alwaysyes)) {
-		warnx("Cannot use -x without -n\n");
+		warnx("Cannot use -x without -n");
 		snap_backup = NULL;
 	}
 	argc -= optind;

Index: src/sbin/gpt/restore.c
diff -u src/sbin/gpt/restore.c:1.7 src/sbin/gpt/restore.c:1.8
--- src/sbin/gpt/restore.c:1.7	Tue Sep 30 21:08:25 2014
+++ src/sbin/gpt/restore.c	Tue Jun 16 19:18:55 2015
@@ -33,7 +33,7 @@
 __FBSDID("$FreeBSD: src/sbin/gpt/create.c,v 1.11 2005/08/31 01:47:19 marcel Exp $");
 #endif
 #ifdef __RCSID
-__RCSID("$NetBSD: restore.c,v 1.7 2014/10/01 01:08:25 jnemeth Exp $");
+__RCSID("$NetBSD: restore.c,v 1.8 2015/06/16 23:18:55 christos Exp $");
 #endif
 
 #include <sys/types.h>
@@ -146,7 +146,7 @@ restore(int fd)
 	PROP_ERR(propstr);
 	s = prop_string_cstring_nocopy(propstr);
 	if (gpt_uuid_parse(s, gpt_guid) != 0) {
-		warnx("%s: not able to convert to an UUID\n", s);
+		warnx("%s: not able to convert to an UUID", s);
 		return;
 	}
 	firstdata = gpt_size + 2;		/* PMBR and GPT header */
@@ -163,7 +163,7 @@ restore(int fd)
 		PROP_ERR(propstr);
 		s = prop_string_cstring_nocopy(propstr);
 		if (gpt_uuid_parse(s, uuid) != 0) {
-			warnx("%s: not able to convert to an UUID\n", s);
+			warnx("%s: not able to convert to an UUID", s);
 			return;
 		}
 		if (gpt_uuid_is_nil(uuid))
@@ -301,14 +301,14 @@ restore(int fd)
 		PROP_ERR(propstr);
 		s = prop_string_cstring_nocopy(propstr);
 		if (gpt_uuid_parse(s, ent.ent_type) != 0) {
-			warnx("%s: not able to convert to an UUID\n", s);
+			warnx("%s: not able to convert to an UUID", s);
 			return;
 		}
 		propstr = prop_dictionary_get(gpt_dict, "guid");
 		PROP_ERR(propstr);
 		s = prop_string_cstring_nocopy(propstr);
 		if (gpt_uuid_parse(s, ent.ent_guid) != 0) {
-			warnx("%s: not able to convert to an UUID\n", s);
+			warnx("%s: not able to convert to an UUID", s);
 			return;
 		}
 		propnum = prop_dictionary_get(gpt_dict, "start");

Index: src/sbin/init/init.c
diff -u src/sbin/init/init.c:1.105 src/sbin/init/init.c:1.106
--- src/sbin/init/init.c:1.105	Fri Nov  9 01:27:17 2012
+++ src/sbin/init/init.c	Tue Jun 16 19:18:55 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: init.c,v 1.105 2012/11/09 06:27:17 msaitoh Exp $	*/
+/*	$NetBSD: init.c,v 1.106 2015/06/16 23:18:55 christos Exp $	*/
 
 /*-
  * Copyright (c) 1991, 1993
@@ -42,7 +42,7 @@ __COPYRIGHT("@(#) Copyright (c) 1991, 19
 #if 0
 static char sccsid[] = "@(#)init.c	8.2 (Berkeley) 4/28/95";
 #else
-__RCSID("$NetBSD: init.c,v 1.105 2012/11/09 06:27:17 msaitoh Exp $");
+__RCSID("$NetBSD: init.c,v 1.106 2015/06/16 23:18:55 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -1720,7 +1720,7 @@ mfs_dev(void)
 		if (waitpid(pid, &status, 0) == -1)
 			break;
 		if (status != 0)
-			warn("MAKEDEV exit status %d\n", status);
+			warn("MAKEDEV exit status %d", status);
 		/*
 		 * If /dev/console got created, then return 0
 		 * regardless of MAKEDEV exit status.

Index: src/sbin/newfs/mkfs.c
diff -u src/sbin/newfs/mkfs.c:1.124 src/sbin/newfs/mkfs.c:1.125
--- src/sbin/newfs/mkfs.c:1.124	Tue Apr 28 21:49:25 2015
+++ src/sbin/newfs/mkfs.c	Tue Jun 16 19:18:55 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: mkfs.c,v 1.124 2015/04/29 01:49:25 christos Exp $	*/
+/*	$NetBSD: mkfs.c,v 1.125 2015/06/16 23:18:55 christos Exp $	*/
 
 /*
  * Copyright (c) 1980, 1989, 1993
@@ -73,7 +73,7 @@
 #if 0
 static char sccsid[] = "@(#)mkfs.c	8.11 (Berkeley) 5/3/95";
 #else
-__RCSID("$NetBSD: mkfs.c,v 1.124 2015/04/29 01:49:25 christos Exp $");
+__RCSID("$NetBSD: mkfs.c,v 1.125 2015/06/16 23:18:55 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -1573,7 +1573,7 @@ ilog2(int val)
 	for (n = 0; n < sizeof(n) * CHAR_BIT; n++)
 		if (1 << n == val)
 			return (n);
-	errx(1, "ilog2: %d is not a power of 2\n", val);
+	errx(1, "ilog2: %d is not a power of 2", val);
 }
 
 static void

Index: src/sbin/newfs_ext2fs/mke2fs.c
diff -u src/sbin/newfs_ext2fs/mke2fs.c:1.21 src/sbin/newfs_ext2fs/mke2fs.c:1.22
--- src/sbin/newfs_ext2fs/mke2fs.c:1.21	Sat Oct 19 09:42:10 2013
+++ src/sbin/newfs_ext2fs/mke2fs.c	Tue Jun 16 19:18:55 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: mke2fs.c,v 1.21 2013/10/19 13:42:10 tsutsui Exp $	*/
+/*	$NetBSD: mke2fs.c,v 1.22 2015/06/16 23:18:55 christos Exp $	*/
 
 /*-
  * Copyright (c) 2007 Izumi Tsutsui.  All rights reserved.
@@ -100,7 +100,7 @@
 #if 0
 static char sccsid[] = "@(#)mkfs.c	8.11 (Berkeley) 5/3/95";
 #else
-__RCSID("$NetBSD: mke2fs.c,v 1.21 2013/10/19 13:42:10 tsutsui Exp $");
+__RCSID("$NetBSD: mke2fs.c,v 1.22 2015/06/16 23:18:55 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -202,27 +202,27 @@ mke2fs(const char *fsys, int fi, int fo)
 	 */
 	if (!powerof2(bsize)) {
 		errx(EXIT_FAILURE,
-		    "block size must be a power of 2, not %u\n",
+		    "block size must be a power of 2, not %u",
 		    bsize);
 	}
 	if (!powerof2(fsize)) {
 		errx(EXIT_FAILURE,
-		    "fragment size must be a power of 2, not %u\n",
+		    "fragment size must be a power of 2, not %u",
 		    fsize);
 	}
 	if (fsize < sectorsize) {
 		errx(EXIT_FAILURE,
-		    "fragment size %u is too small, minimum is %u\n",
+		    "fragment size %u is too small, minimum is %u",
 		    fsize, sectorsize);
 	}
 	if (bsize < MINBSIZE) {
 		errx(EXIT_FAILURE,
-		    "block size %u is too small, minimum is %u\n",
+		    "block size %u is too small, minimum is %u",
 		    bsize, MINBSIZE);
 	}
 	if (bsize > EXT2_MAXBSIZE) {
 		errx(EXIT_FAILURE,
-		    "block size %u is too large, maximum is %u\n",
+		    "block size %u is too large, maximum is %u",
 		    bsize, MAXBSIZE);
 	}
 	if (bsize != fsize) {
@@ -233,14 +233,14 @@ mke2fs(const char *fsys, int fi, int fo)
 		 */
 		errx(EXIT_FAILURE,
 		    "block size (%u) can't be different from "
-		    "fragment size (%u)\n",
+		    "fragment size (%u)",
 		    bsize, fsize);
 	}
 
 	/* variable inodesize is REV1 feature */
 	if (Oflag == 0 && inodesize != EXT2_REV0_DINODE_SIZE) {
 		errx(EXIT_FAILURE, "GOOD_OLD_REV file system format"
-		    " doesn't support %d byte inode\n", inodesize);
+		    " doesn't support %d byte inode", inodesize);
 	}
 
 	sblock.e2fs.e2fs_log_bsize = ilog2(bsize) - LOG_MINBSIZE;
@@ -276,7 +276,7 @@ mke2fs(const char *fsys, int fi, int fo)
 
 	if (fssize < minfssize)
 		errx(EXIT_FAILURE, "Filesystem size %" PRId64
-		    " < minimum size of %" PRId64 "\n", fssize, minfssize);
+		    " < minimum size of %" PRId64, fssize, minfssize);
 
 	bcount = EXT2_DBTOFSB(&sblock, fssize);
 
@@ -410,7 +410,7 @@ mke2fs(const char *fsys, int fi, int fo)
 
 	uuid_create(&uuid, &uustat);
 	if (uustat != uuid_s_ok)
-		errx(EXIT_FAILURE, "Failed to generate uuid\n");
+		errx(EXIT_FAILURE, "Failed to generate uuid");
 	uuid_enc_le(sblock.e2fs.e2fs_uuid, &uuid);
 	if (volname != NULL) {
 		if (strlen(volname) > sizeof(sblock.e2fs.e2fs_vname))
@@ -543,7 +543,7 @@ mke2fs(const char *fsys, int fi, int fo)
 	iobuf = mmap(0, iobufsize, PROT_READ|PROT_WRITE,
 	    MAP_ANON|MAP_PRIVATE, -1, 0);
 	if (iobuf == NULL)
-		errx(EXIT_FAILURE, "Cannot allocate I/O buffer\n");
+		errx(EXIT_FAILURE, "Cannot allocate I/O buffer");
 	memset(iobuf, 0, iobufsize);
 
 	/*
@@ -559,7 +559,7 @@ mke2fs(const char *fsys, int fi, int fo)
 		 * Convert to file system fragment sized units.
 		 */
 		if (fssize <= 0)
-			errx(EXIT_FAILURE, "Preposterous size %" PRId64 "\n",
+			errx(EXIT_FAILURE, "Preposterous size %" PRId64,
 			    fssize);
 		wtfs(fssize - 1, sectorsize, iobuf);
 
@@ -1130,7 +1130,7 @@ init_resizeino(const struct timeval *tv)
 	     EXT2F_ROCOMPAT_LARGEFILE) == 0) {
 		/* XXX should enable it here and update all backups? */
 		errx(EXIT_FAILURE, "%s: large_file rocompat feature is "
-		    "required to enable resize feature for this filesystem\n",
+		    "required to enable resize feature for this filesystem",
 		    __func__);
 	}
 	/* upper 32bit is stored into e2di_dacl on REV1 feature */
@@ -1296,7 +1296,7 @@ alloc(uint32_t size, uint16_t mode)
 	
  gotit:
 	if (isset(bbp, bno))
-		errx(EXIT_FAILURE, "%s: inconsistent bitmap\n", __func__);
+		errx(EXIT_FAILURE, "%s: inconsistent bitmap", __func__);
 
 	setbit(bbp, bno);
 	wtfs(EXT2_FSBTODB(&sblock, gd[0].ext2bgd_b_bitmap),
@@ -1326,7 +1326,7 @@ iput(struct ext2fs_dinode *ip, ino_t ino
 
 	bp = malloc(sblock.e2fs_bsize);
 	if (bp == NULL)
-		errx(EXIT_FAILURE, "%s: can't allocate buffer for inode\n",
+		errx(EXIT_FAILURE, "%s: can't allocate buffer for inode",
 		    __func__);
 
 	/*
@@ -1339,7 +1339,7 @@ iput(struct ext2fs_dinode *ip, ino_t ino
 		/* sanity check */
 		if (gd[c].ext2bgd_nifree == 0)
 			errx(EXIT_FAILURE,
-			    "%s: no free inode %" PRIu64 " in block group %u\n",
+			    "%s: no free inode %" PRIu64 " in block group %u",
 			    __func__, (uint64_t)ino, c);
 
 		/* update inode bitmap */
@@ -1349,7 +1349,7 @@ iput(struct ext2fs_dinode *ip, ino_t ino
 		/* more sanity */
 		if (isset(bp, EXT2_INO_INDEX(ino)))
 			errx(EXIT_FAILURE, "%s: inode %" PRIu64
-			    " already in use\n", __func__, (uint64_t)ino);
+			    " already in use", __func__, (uint64_t)ino);
 		setbit(bp, EXT2_INO_INDEX(ino));
 		wtfs(EXT2_FSBTODB(&sblock, gd[0].ext2bgd_i_bitmap),
 		    sblock.e2fs_bsize, bp);
@@ -1359,7 +1359,7 @@ iput(struct ext2fs_dinode *ip, ino_t ino
 
 	if (ino >= sblock.e2fs.e2fs_ipg * sblock.e2fs_ncg)
 		errx(EXIT_FAILURE, "%s: inode value out of range (%" PRIu64
-		    ").\n", __func__, (uint64_t)ino);
+		    ")", __func__, (uint64_t)ino);
 
 	/* update an inode entry in the table */
 	d = EXT2_FSBTODB(&sblock, ino_to_fsba(&sblock, ino));
@@ -1419,7 +1419,7 @@ ilog2(uint val)
 {
 
 	if (val == 0 || !powerof2(val))
-		errx(EXIT_FAILURE, "%s: %u is not a power of 2\n",
+		errx(EXIT_FAILURE, "%s: %u is not a power of 2",
 		    __func__, val);
 
 	return ffs(val) - 1;

Index: src/sbin/newfs_udf/udf_create.c
diff -u src/sbin/newfs_udf/udf_create.c:1.24 src/sbin/newfs_udf/udf_create.c:1.25
--- src/sbin/newfs_udf/udf_create.c:1.24	Fri Oct 18 21:09:59 2013
+++ src/sbin/newfs_udf/udf_create.c	Tue Jun 16 19:18:55 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: udf_create.c,v 1.24 2013/10/19 01:09:59 christos Exp $ */
+/* $NetBSD: udf_create.c,v 1.25 2015/06/16 23:18:55 christos Exp $ */
 
 /*
  * Copyright (c) 2006, 2008 Reinoud Zandijk
@@ -30,7 +30,7 @@
 #endif
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: udf_create.c,v 1.24 2013/10/19 01:09:59 christos Exp $");
+__RCSID("$NetBSD: udf_create.c,v 1.25 2015/06/16 23:18:55 christos Exp $");
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -1579,7 +1579,7 @@ udf_fidsize(struct fileid_desc *fid)
 	uint32_t size;
 
 	if (udf_rw16(fid->tag.id) != TAGID_FID)
-		errx(EINVAL, "got udf_fidsize on non FID\n");
+		errx(EINVAL, "got udf_fidsize on non FID");
 
 	size = UDF_FID_SIZE + fid->l_fi + udf_rw16(fid->l_iu);
 	size = (size + 3) & ~3;

Index: src/sbin/newfs_v7fs/newfs_v7fs.c
diff -u src/sbin/newfs_v7fs/newfs_v7fs.c:1.3 src/sbin/newfs_v7fs/newfs_v7fs.c:1.4
--- src/sbin/newfs_v7fs/newfs_v7fs.c:1.3	Wed Aug 10 08:13:20 2011
+++ src/sbin/newfs_v7fs/newfs_v7fs.c	Tue Jun 16 19:18:55 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: newfs_v7fs.c,v 1.3 2011/08/10 12:13:20 wiz Exp $ */
+/*	$NetBSD: newfs_v7fs.c,v 1.4 2015/06/16 23:18:55 christos Exp $ */
 
 /*-
  * Copyright (c) 2004, 2011 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: newfs_v7fs.c,v 1.3 2011/08/10 12:13:20 wiz Exp $");
+__RCSID("$NetBSD: newfs_v7fs.c,v 1.4 2015/06/16 23:18:55 christos Exp $");
 #endif /* not lint */
 
 #include <sys/types.h>
@@ -131,7 +131,7 @@ main(int argc, char **argv)
 			goto err_exit;
 		}
 		if (!S_ISCHR(st.st_mode)) {
-			warnx("not a raw device.\n");
+			warnx("not a raw device");
 		}
 
 		part = DISKPART(st.st_rdev);
@@ -146,7 +146,7 @@ main(int argc, char **argv)
 			    p->p_fstype, d.d_secsize);
 		}
 		if (p->p_fstype != FS_V7) {
-			warnx("not a Version 7 partition.");
+			warnx("not a Version 7 partition");
 			goto err_exit;
 		}
 		partsize = p->p_size;

Index: src/sbin/veriexecctl/veriexecctl.c
diff -u src/sbin/veriexecctl/veriexecctl.c:1.38 src/sbin/veriexecctl/veriexecctl.c:1.39
--- src/sbin/veriexecctl/veriexecctl.c:1.38	Sun Apr 26 05:20:09 2015
+++ src/sbin/veriexecctl/veriexecctl.c	Tue Jun 16 19:18:55 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: veriexecctl.c,v 1.38 2015/04/26 09:20:09 maxv Exp $	*/
+/*	$NetBSD: veriexecctl.c,v 1.39 2015/06/16 23:18:55 christos Exp $	*/
 
 /*-
  * Copyright 2005 Elad Efrat <[email protected]>
@@ -129,7 +129,7 @@ print_query(prop_dictionary_t qp, char *
 	char buf[64];
 
 	if (statvfs(file, &sv) != 0)
-		err(1, "Can't statvfs() `%s'\n", file);
+		err(EXIT_FAILURE, "Can't statvfs() `%s'", file);
 
 	printf("Filename: %s\n", file);
 	printf("Mount: %s\n", sv.f_mntonname);
@@ -228,7 +228,7 @@ main(int argc, char **argv)
 	argv += optind;
 
 	if ((gfd = open(VERIEXEC_DEVICE, O_RDWR, 0)) == -1)
-		err(1, "Cannot open `%s'", VERIEXEC_DEVICE);
+		err(EXIT_FAILURE, "Cannot open `%s'", VERIEXEC_DEVICE);
 
 	/*
 	 * Handle the different commands we can do.
@@ -245,7 +245,7 @@ main(int argc, char **argv)
 
 		lfd = open(file, O_RDONLY|O_EXLOCK, 0);
 		if (lfd == -1)
-			err(1, "Cannot open `%s'", file);
+			err(EXIT_FAILURE, "Cannot open `%s'", file);
 
 		yyin = fdopen(lfd, "r");
 		yyparse();
@@ -258,21 +258,21 @@ main(int argc, char **argv)
 		struct stat sb;
 
 		if (stat(argv[1], &sb) == -1)
-			err(1, "Can't stat `%s'", argv[1]);
+			err(EXIT_FAILURE, "Can't stat `%s'", argv[1]);
 
 		/*
 		 * If it's a regular file, remove it. If it's a directory,
 		 * remove the entire table. If it's neither, abort.
 		 */
 		if (!S_ISDIR(sb.st_mode) && !S_ISREG(sb.st_mode))
-			errx(1, "`%s' is not a regular file or directory.",
+			errx(EXIT_FAILURE, "`%s' is not a regular file or directory.",
 			    argv[1]);
 
 		dp = prop_dictionary_create();
 		dict_sets(dp, "file", argv[1]);
 
 		if (prop_dictionary_send_ioctl(dp, gfd, VERIEXEC_DELETE) != 0)
-			err(1, "Error deleting `%s'", argv[1]);
+			err(EXIT_FAILURE, "Error deleting `%s'", argv[1]);
 
 		prop_object_release(dp);
 	} else if (argc == 2 && strcasecmp(argv[0], "query") == 0) {
@@ -287,9 +287,9 @@ main(int argc, char **argv)
 		    &rqp);
 		if (r) {
 			if (r == ENOENT)
-				errx(1, "No Veriexec entry for `%s'", argv[1]);
+				errx(EXIT_FAILURE, "No Veriexec entry for `%s'", argv[1]);
 
-			err(1, "Error querying `%s'", argv[1]);
+			err(EXIT_FAILURE, "Error querying `%s'", argv[1]);
 		}
 
 		if (rqp != NULL) {
@@ -304,7 +304,7 @@ main(int argc, char **argv)
 
 		if (prop_array_recv_ioctl(gfd, VERIEXEC_DUMP,
 		    &entries) == -1)
-			err(1, "Error dumping tables");
+			err(EXIT_FAILURE, "Error dumping tables");
 
 		nentries = prop_array_count(entries);
 		for (i = 0; i < nentries; i++)
@@ -313,7 +313,7 @@ main(int argc, char **argv)
 		prop_object_release(entries);
 	} else if (argc == 1 && strcasecmp(argv[0], "flush") == 0) {
 		if (ioctl(gfd, VERIEXEC_FLUSH) == -1)
-			err(1, "Cannot flush Veriexec database");
+			err(EXIT_FAILURE, "Cannot flush Veriexec database");
 	} else
 		usage();
 

Reply via email to