Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sbin fix error messages containing \n



details:   https://anonhg.NetBSD.org/src/rev/afbe7d17fdfb
branches:  trunk
changeset: 338914:afbe7d17fdfb
user:      christos <christos%NetBSD.org@localhost>
date:      Tue Jun 16 23:18:54 2015 +0000

description:
fix error messages containing \n

diffstat:

 sbin/cgdconfig/params.c        |   8 ++++----
 sbin/dmctl/dmctl.c             |   4 ++--
 sbin/fdisk/fdisk.c             |   8 ++++----
 sbin/fsck_ffs/main.c           |   6 +++---
 sbin/fsck_lfs/inode.c          |   6 +++---
 sbin/fsck_lfs/main.c           |   6 +++---
 sbin/fsck_lfs/pass2.c          |   8 ++++----
 sbin/fsck_lfs/pass4.c          |   4 ++--
 sbin/fsck_lfs/segwrite.c       |  20 ++++++++++----------
 sbin/fsck_lfs/utilities.c      |   4 ++--
 sbin/fsck_msdos/main.c         |   6 +++---
 sbin/gpt/restore.c             |  10 +++++-----
 sbin/init/init.c               |   6 +++---
 sbin/newfs/mkfs.c              |   6 +++---
 sbin/newfs_ext2fs/mke2fs.c     |  40 ++++++++++++++++++++--------------------
 sbin/newfs_udf/udf_create.c    |   6 +++---
 sbin/newfs_v7fs/newfs_v7fs.c   |   8 ++++----
 sbin/veriexecctl/veriexecctl.c |  22 +++++++++++-----------
 18 files changed, 89 insertions(+), 89 deletions(-)

diffs (truncated from 771 to 300 lines):

diff -r 7d56bf55967c -r afbe7d17fdfb sbin/cgdconfig/params.c
--- a/sbin/cgdconfig/params.c   Tue Jun 16 23:04:13 2015 +0000
+++ b/sbin/cgdconfig/params.c   Tue Jun 16 23:18:54 2015 +0000
@@ -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 @@
 
        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 @@
        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;
 }
 
diff -r 7d56bf55967c -r afbe7d17fdfb sbin/dmctl/dmctl.c
--- a/sbin/dmctl/dmctl.c        Tue Jun 16 23:04:13 2015 +0000
+++ b/sbin/dmctl/dmctl.c        Tue Jun 16 23:18:54 2015 +0000
@@ -291,7 +291,7 @@
        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 @@
 
        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;
 
diff -r 7d56bf55967c -r afbe7d17fdfb sbin/fdisk/fdisk.c
--- a/sbin/fdisk/fdisk.c        Tue Jun 16 23:04:13 2015 +0000
+++ b/sbin/fdisk/fdisk.c        Tue Jun 16 23:18:54 2015 +0000
@@ -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 @@
                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 @@
                else
                        errtext = check_overlap(part, sysid, start, size, 1);
                if (errtext)
-                       errx(1, "%s\n", errtext);
+                       errx(1, "%s", errtext);
        }
 
 
diff -r 7d56bf55967c -r afbe7d17fdfb sbin/fsck_ffs/main.c
--- a/sbin/fsck_ffs/main.c      Tue Jun 16 23:04:13 2015 +0000
+++ b/sbin/fsck_ffs/main.c      Tue Jun 16 23:18:54 2015 +0000
@@ -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 @@
 #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 @@
 
        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;
                }
diff -r 7d56bf55967c -r afbe7d17fdfb sbin/fsck_lfs/inode.c
--- a/sbin/fsck_lfs/inode.c     Tue Jun 16 23:04:13 2015 +0000
+++ b/sbin/fsck_lfs/inode.c     Tue Jun 16 23:18:54 2015 +0000
@@ -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 @@
                        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 @@
                return;
 
        default:
-               err(EEXIT, "BAD STATE %d TO BLKERR\n", statemap[ino]);
+               err(EEXIT, "BAD STATE %d TO BLKERR", statemap[ino]);
                /* NOTREACHED */
        }
 }
diff -r 7d56bf55967c -r afbe7d17fdfb sbin/fsck_lfs/main.c
--- a/sbin/fsck_lfs/main.c      Tue Jun 16 23:04:13 2015 +0000
+++ b/sbin/fsck_lfs/main.c      Tue Jun 16 23:18:54 2015 +0000
@@ -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 @@
                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 @@
 
        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);
 }
 
diff -r 7d56bf55967c -r afbe7d17fdfb sbin/fsck_lfs/pass2.c
--- a/sbin/fsck_lfs/pass2.c     Tue Jun 16 23:04:13 2015 +0000
+++ b/sbin/fsck_lfs/pass2.c     Tue Jun 16 23:18:54 2015 +0000
@@ -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 @@
                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 @@
                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 @@
                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;
diff -r 7d56bf55967c -r afbe7d17fdfb sbin/fsck_lfs/pass4.c
--- a/sbin/fsck_lfs/pass4.c     Tue Jun 16 23:04:13 2015 +0000
+++ b/sbin/fsck_lfs/pass4.c     Tue Jun 16 23:18:54 2015 +0000
@@ -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 @@
                        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);
                }
        }
diff -r 7d56bf55967c -r afbe7d17fdfb sbin/fsck_lfs/segwrite.c
--- a/sbin/fsck_lfs/segwrite.c  Tue Jun 16 23:04:13 2015 +0000
+++ b/sbin/fsck_lfs/segwrite.c  Tue Jun 16 23:18:54 2015 +0000
@@ -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 @@
 
        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 @@
        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 @@
                 * 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 @@
        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_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 @@
        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 @@
                --fs->lfs_seglock;
                fs->lfs_lockpid = 0;
        } else if (fs->lfs_seglock == 0) {
-               errx(1, "Seglock not held");



Home | Main Index | Thread Index | Old Index