From steve@basement.virtual-voodoo.com  Wed Apr 27 16:39:56 2005
Return-Path: <steve@basement.virtual-voodoo.com>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 7789016A4CE
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 27 Apr 2005 16:39:56 +0000 (GMT)
Received: from basement.virtual-voodoo.com (12-202-93-96.client.insightBB.com [12.202.93.96])
	by mx1.FreeBSD.org (Postfix) with ESMTP id E705143D1D
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 27 Apr 2005 16:39:55 +0000 (GMT)
	(envelope-from steve@basement.virtual-voodoo.com)
Received: from basement.virtual-voodoo.com (localhost [127.0.0.1])
	by basement.virtual-voodoo.com (8.13.3/8.13.3) with ESMTP id j3RGdsmY085559
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 27 Apr 2005 11:39:55 -0500 (EST)
	(envelope-from steve@basement.virtual-voodoo.com)
Received: (from root@localhost)
	by basement.virtual-voodoo.com (8.13.3/8.13.3/Submit) id j3RGdslv082937;
	Wed, 27 Apr 2005 11:39:54 -0500 (EST)
	(envelope-from steve)
Message-Id: <200504271639.j3RGdslv082937@basement.virtual-voodoo.com>
Date: Wed, 27 Apr 2005 11:39:54 -0500 (EST)
From: Steve Ames <steve@virtual-voodoo.com>
Reply-To: Steve Ames <steve@virtual-voodoo.com>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: bin/df/df.c sign errors in calls to getbsize
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         80411
>Category:       bin
>Synopsis:       [patch] df(1): bin/df/df.c sign errors in calls to getbsize
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    kan
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Apr 27 16:40:10 GMT 2005
>Closed-Date:    Thu May 07 12:39:57 UTC 2009
>Last-Modified:  Thu May 07 12:39:57 UTC 2009
>Originator:     Steve Ames
>Release:        FreeBSD 6.0-CURRENT i386
>Organization:
>Environment:
System: FreeBSD basement.virtual-voodoo.com 6.0-CURRENT FreeBSD 6.0-CURRENT #48: Sun Apr 24 13:04:02 EST 2005 steve@basement.virtual-voodoo.com:/usr/obj/usr/src/sys/SB i386


>Description:
	in bin/df/df.c calls are made getbsize(3) using a variable of
        type u_long when the prototype specifically requests long:

        char *getbsize(int *headerlenp, long *blocksizep);

        The solution is to fix the calls to send signed long instead of
        u_long. I'm fairly sure that a negative value will never be 
        placed in blocksizep so u_long seems to be appropriate but until
        (and unless) the prototype and library are changed to unsigned
        then calls to getbsize should use signed variables to avoid
        confusion. This becomes more true with gcc4.0 and higher where
        sign warnings are flagged a little heavier.


>How-To-Repeat:
	Not Applicable

>Fix:

--- df.c.old    Wed Apr 27 11:28:11 2005
+++ df.c        Wed Apr 27 11:29:32 2005
@@ -372,7 +372,7 @@
static void
prtstat(struct statfs *sfsp, struct maxwidths *mwp)
{
-       static u_long blocksize;
+       static long blocksize;
       static int headerlen, timesthrough = 0;
       static const char *header;
       int64_t used, availblks, inodes;
@@ -449,7 +449,7 @@
static void
update_maxwidths(struct maxwidths *mwp, const struct statfs *sfsp)
{
-       static u_long blocksize = 0;
+       static long blocksize = 0;
       int dummy;

       if (blocksize == 0)



>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->patched 
State-Changed-By: vwe 
State-Changed-When: Wed Mar 12 02:17:41 UTC 2008 
State-Changed-Why:  

has been committed to cvs: rev. 1.68 for HEAD and RELENG_7 
no MFC marked in commit message, no MFC done 


Responsible-Changed-From-To: freebsd-bugs->kan 
Responsible-Changed-By: vwe 
Responsible-Changed-When: Wed Mar 12 02:17:41 UTC 2008 
Responsible-Changed-Why:  

Over to maintainer. 
Reassing to kan who appears to have this change committed. 
kan, would you please check for the MFC? 

http://www.freebsd.org/cgi/query-pr.cgi?pr=80411 
State-Changed-From-To: patched->closed 
State-Changed-By: kan 
State-Changed-When: Thu May 7 12:38:48 UTC 2009 
State-Changed-Why:  
This was never supposed to be MFCed, so PR had no reason to remain open. 
Now of course all of this is history. 


http://www.freebsd.org/cgi/query-pr.cgi?pr=80411 
>Unformatted:
