From owner-freebsd-bugs@FreeBSD.ORG Fri Jan 18 13:00:01 2013 Return-Path: Delivered-To: freebsd-bugs@smarthost.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 940CF886 for ; Fri, 18 Jan 2013 13:00:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 78232737 for ; Fri, 18 Jan 2013 13:00:01 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.6/8.14.6) with ESMTP id r0ID019Z031803 for ; Fri, 18 Jan 2013 13:00:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.6/8.14.6/Submit) id r0ID017V031802; Fri, 18 Jan 2013 13:00:01 GMT (envelope-from gnats) Resent-Date: Fri, 18 Jan 2013 13:00:01 GMT Resent-Message-Id: <201301181300.r0ID017V031802@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Christoph Mallon Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 4C9D583B for ; Fri, 18 Jan 2013 12:59:02 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22]) by mx1.freebsd.org (Postfix) with ESMTP id 1BBD5724 for ; Fri, 18 Jan 2013 12:59:02 +0000 (UTC) Received: from red.freebsd.org (localhost [127.0.0.1]) by red.freebsd.org (8.14.5/8.14.5) with ESMTP id r0ICx1GL084267 for ; Fri, 18 Jan 2013 12:59:01 GMT (envelope-from nobody@red.freebsd.org) Received: (from nobody@localhost) by red.freebsd.org (8.14.5/8.14.5/Submit) id r0ICx1dL084266; Fri, 18 Jan 2013 12:59:01 GMT (envelope-from nobody) Message-Id: <201301181259.r0ICx1dL084266@red.freebsd.org> Date: Fri, 18 Jan 2013 12:59:01 GMT From: Christoph Mallon To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Subject: bin/175404: patches for sbin/newfs_msdos X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jan 2013 13:00:01 -0000 >Number: 175404 >Category: bin >Synopsis: patches for sbin/newfs_msdos >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Fri Jan 18 13:00:00 UTC 2013 >Closed-Date: >Last-Modified: >Originator: Christoph Mallon >Release: - >Organization: >Environment: - >Description: A reminder requested by pfg@. Two patches for newfs_msdos: - The first simplifies some diagnostic messages from using {err,warn}x() to {err,warn}(). - The second makes some diagnostic messages more canocical by making the first letter lowercase. (Sorry for concatenating them. The form only allows to attach one file.) >How-To-Repeat: >Fix: Patch attached with submission follows: >From a178341a099b073226f1f6e95d427e0e73702ca7 Mon Sep 17 00:00:00 2001 From: Christoph Mallon Date: Fri, 18 Jan 2013 12:25:50 +0100 Subject: [PATCH 1/2] newfs_msdos: Use {err,warn}(...) instead of {err,warn}x(..., strerror(errno)). --- sbin/newfs_msdos/newfs_msdos.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sbin/newfs_msdos/newfs_msdos.c b/sbin/newfs_msdos/newfs_msdos.c index c2e9a35..83e65ed 100644 --- a/sbin/newfs_msdos/newfs_msdos.c +++ b/sbin/newfs_msdos/newfs_msdos.c @@ -832,18 +832,18 @@ getdiskinfo(int fd, const char *fname, const char *dtype, __unused int oflag, if (ioctl(fd, DIOCGDINFO, &dlp) == -1) { if (bpb->bpbBytesPerSec == 0 && ioctl(fd, DIOCGSECTORSIZE, &dlp.d_secsize) == -1) - errx(1, "Cannot get sector size, %s", strerror(errno)); + err(1, "Cannot get sector size"); dlp.d_secperunit = ms / dlp.d_secsize; if (bpb->bpbSecPerTrack == 0 && ioctl(fd, DIOCGFWSECTORS, &dlp.d_nsectors) == -1) { - warnx("Cannot get number of sectors per track, %s", strerror(errno)); + warn("Cannot get number of sectors per track"); dlp.d_nsectors = 63; } if (bpb->bpbHeads == 0 && ioctl(fd, DIOCGFWHEADS, &dlp.d_ntracks) == -1) { - warnx("Cannot get number of heads, %s", strerror(errno)); + warn("Cannot get number of heads"); if (dlp.d_secperunit <= 63*1*1024) dlp.d_ntracks = 1; else if (dlp.d_secperunit <= 63*16*1024) -- 1.8.1 >From 39559da3baa7bb598d1d930c3fab5a0ff750a960 Mon Sep 17 00:00:00 2001 From: Christoph Mallon Date: Fri, 18 Jan 2013 12:53:51 +0100 Subject: [PATCH 2/2] newfs_msdos: Use lowercase letters for the first letter of diagnostic messages. --- sbin/newfs_msdos/newfs_msdos.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sbin/newfs_msdos/newfs_msdos.c b/sbin/newfs_msdos/newfs_msdos.c index 83e65ed..fe1631a 100644 --- a/sbin/newfs_msdos/newfs_msdos.c +++ b/sbin/newfs_msdos/newfs_msdos.c @@ -808,7 +808,7 @@ getdiskinfo(int fd, const char *fname, const char *dtype, __unused int oflag, struct stat st; if (fstat(fd, &st)) - err(1, "Cannot get disk size"); + err(1, "cannot get disk size"); /* create a fake geometry for a file image */ ms = st.st_size; dlp.d_secsize = 512; @@ -832,18 +832,18 @@ getdiskinfo(int fd, const char *fname, const char *dtype, __unused int oflag, if (ioctl(fd, DIOCGDINFO, &dlp) == -1) { if (bpb->bpbBytesPerSec == 0 && ioctl(fd, DIOCGSECTORSIZE, &dlp.d_secsize) == -1) - err(1, "Cannot get sector size"); + err(1, "cannot get sector size"); dlp.d_secperunit = ms / dlp.d_secsize; if (bpb->bpbSecPerTrack == 0 && ioctl(fd, DIOCGFWSECTORS, &dlp.d_nsectors) == -1) { - warn("Cannot get number of sectors per track"); + warn("cannot get number of sectors per track"); dlp.d_nsectors = 63; } if (bpb->bpbHeads == 0 && ioctl(fd, DIOCGFWHEADS, &dlp.d_ntracks) == -1) { - warn("Cannot get number of heads"); + warn("cannot get number of heads"); if (dlp.d_secperunit <= 63*1*1024) dlp.d_ntracks = 1; else if (dlp.d_secperunit <= 63*16*1024) -- 1.8.1 >Release-Note: >Audit-Trail: >Unformatted: