From nobody@FreeBSD.org  Fri Jan 18 12:59:02 2013
Return-Path: <nobody@FreeBSD.org>
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 <freebsd-gnats-submit@FreeBSD.org>; 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 <freebsd-gnats-submit@FreeBSD.org>; 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 <freebsd-gnats-submit@FreeBSD.org>; 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 <christoph.mallon@gmx.de>
To: freebsd-gnats-submit@FreeBSD.org
Subject: patches for sbin/newfs_msdos
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         175404
>Category:       bin
>Synopsis:       patches for sbin/newfs_msdos
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pfg
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Fri Jan 18 13:00:00 UTC 2013
>Closed-Date:    Tue Jan 22 03:45:46 UTC 2013
>Last-Modified:  Tue Jan 22 03:50:01 UTC 2013
>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 <christoph.mallon@gmx.de>
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 <christoph.mallon@gmx.de>
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:
Responsible-Changed-From-To: freebsd-bugs->pfg 
Responsible-Changed-By: pfg 
Responsible-Changed-When: Fri Jan 18 15:40:58 UTC 2013 
Responsible-Changed-Why:  
Grab there are some related issues I have to look at. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=175404 
State-Changed-From-To: open->patched 
State-Changed-By: pfg 
State-Changed-When: Sat Jan 19 03:36:06 UTC 2013 
State-Changed-Why:  
Committed: MFC in 3 days. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=175404 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/175404: commit references a PR
Date: Sat, 19 Jan 2013 03:34:09 +0000 (UTC)

 Author: pfg
 Date: Sat Jan 19 03:34:02 2013
 New Revision: 245648
 URL: http://svnweb.freebsd.org/changeset/base/245648
 
 Log:
   newfs_msdos: cosmetical cleanups
   
   - Simplify diagnostic messages.
   - Adopt lowercase first letters to make the messages
     more canonical.
   
   PR:		bin/175404
   Submitted by:	Christoph Mallon
   Reviewed by:	bde
   MFC after:	3 days
 
 Modified:
   head/sbin/newfs_msdos/newfs_msdos.c
 
 Modified: head/sbin/newfs_msdos/newfs_msdos.c
 ==============================================================================
 --- head/sbin/newfs_msdos/newfs_msdos.c	Sat Jan 19 03:19:39 2013	(r245647)
 +++ head/sbin/newfs_msdos/newfs_msdos.c	Sat Jan 19 03:34:02 2013	(r245648)
 @@ -808,7 +808,7 @@ getdiskinfo(int fd, const char *fname, c
  	    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, c
  	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)
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: patched->closed 
State-Changed-By: pfg 
State-Changed-When: Tue Jan 22 03:44:39 UTC 2013 
State-Changed-Why:  
MFC'd. Thank you for your contribution. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=175404 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/175404: commit references a PR
Date: Tue, 22 Jan 2013 03:43:36 +0000 (UTC)

 Author: pfg
 Date: Tue Jan 22 03:43:28 2013
 New Revision: 245764
 URL: http://svnweb.freebsd.org/changeset/base/245764
 
 Log:
   MFC	r245648:
   
   newfs_msdos: cosmetical cleanups
   
   - Simplify diagnostic messages.
   - Adopt lowercase first letters to make the messages
     more canonical.
   
   PR:		bin/175404
   Submitted by:	Christoph Mallon
   Reviewed by:	bde
 
 Modified:
   stable/8/sbin/newfs_msdos/newfs_msdos.c
 
 Modified: stable/8/sbin/newfs_msdos/newfs_msdos.c
 ==============================================================================
 --- stable/8/sbin/newfs_msdos/newfs_msdos.c	Tue Jan 22 03:39:55 2013	(r245763)
 +++ stable/8/sbin/newfs_msdos/newfs_msdos.c	Tue Jan 22 03:43:28 2013	(r245764)
 @@ -808,7 +808,7 @@ getdiskinfo(int fd, const char *fname, c
  	    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, c
  	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)
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/175404: commit references a PR
Date: Tue, 22 Jan 2013 03:40:02 +0000 (UTC)

 Author: pfg
 Date: Tue Jan 22 03:39:55 2013
 New Revision: 245763
 URL: http://svnweb.freebsd.org/changeset/base/245763
 
 Log:
   MFC	r245648:
   
   newfs_msdos: cosmetical cleanups
   
   - Simplify diagnostic messages.
   - Adopt lowercase first letters to make the messages
     more canonical.
   
   PR:		bin/175404
   Submitted by:	Christoph Mallon
   Reviewed by:	bde
 
 Modified:
   stable/9/sbin/newfs_msdos/newfs_msdos.c
 
 Modified: stable/9/sbin/newfs_msdos/newfs_msdos.c
 ==============================================================================
 --- stable/9/sbin/newfs_msdos/newfs_msdos.c	Tue Jan 22 03:32:13 2013	(r245762)
 +++ stable/9/sbin/newfs_msdos/newfs_msdos.c	Tue Jan 22 03:39:55 2013	(r245763)
 @@ -808,7 +808,7 @@ getdiskinfo(int fd, const char *fname, c
  	    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, c
  	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)
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
>Unformatted:
