From dan@obluda.cz  Wed Jun 26 17:48:15 2002
Return-Path: <dan@obluda.cz>
Received: from xkulesh.vol.cz (xkulesh.vol.cz [195.250.154.106])
	by hub.freebsd.org (Postfix) with ESMTP id F0E5037D0E0
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 26 Jun 2002 17:37:33 -0700 (PDT)
Received: from obluda.cz (localhost [127.0.0.1])
	by xkulesh.vol.cz (8.12.3/8.12.3) with ESMTP id g5R0bVTx061818
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 27 Jun 2002 02:37:31 +0200 (CEST)
	(envelope-from dan@obluda.cz)
Received: (from root@localhost)
	by obluda.cz (8.12.4/8.12.4/Submit) id g5R0F6ps061160;
	Thu, 27 Jun 2002 02:15:06 +0200 (CEST)
Message-Id: <200206270015.g5R0F6ps061160@obluda.cz>
Date: Thu, 27 Jun 2002 02:15:06 +0200 (CEST)
From: Dan Lukes <dan@obluda.cz>
Reply-To: Dan Lukes <dan@obluda.cz>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: cleaning sbin/savecore code from warnings
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         39907
>Category:       bin
>Synopsis:       cleaning sbin/savecore code from warnings
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    johan
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jun 26 17:50:02 PDT 2002
>Closed-Date:    Sun Apr 13 13:52:53 PDT 2003
>Last-Modified:  Sun Apr 13 13:52:53 PDT 2003
>Originator:     Dan Lukes
>Release:        FreeBSD 4.6-STABLE i386
>Organization:
Obludarium
>Environment:
System: FreeBSD xkulesh.vol.cz 4.6-STABLE FreeBSD
src/sbin/savecore/savecore.c,v 1.28.2.13 2002/04/07 21:17:50

>Description:
sbin/savecore/savecore.c: In function `dump_exists':
354: warning: unsigned int format, u_long arg (arg 3)
354: warning: unsigned int format, u_long arg (arg 4)

/usr/src/sbin/savecore/savecore.c: In function `save_core':
420: warning: int format, different type arg (arg 2)
   dumpsize is (off_t) e.g. (_BSD_OFF_T) e.g. (__int64_t) e.g. (long long)



>How-To-Repeat:
        N/A
>Fix:
--- sbin/savecore/savecore.c.ORIG     Mon Apr  8 01:16:19 2002
+++ sbin/savecore/savecore.c  Thu Jun 27 02:12:31 2002
@@ -350,7 +350,7 @@
            (off_t)(dumplo + ok(dump_nl[X_DUMPMAG].n_value)), L_SET);
        if (newdumpmag != dumpmag) {
                if (verbose)
-                       syslog(LOG_WARNING, "magic number mismatch (%x != %x)",
+                       syslog(LOG_WARNING, "magic number mismatch (%lx != %lx)",
                            newdumpmag, dumpmag);
                syslog(LOG_WARNING, "no core dump");
                return (0);
@@ -417,7 +417,7 @@
        syslog(LOG_NOTICE, "writing %score to %s",
            compress ? "compressed " : "", path);
        for (; dumpsize > 0; dumpsize -= nr) {
-               (void)printf("%6dK\r", dumpsize / 1024);
+               (void)printf("%6lldK\r", dumpsize / 1024);
                (void)fflush(stdout);
                nr = read(dumpfd, buf, MIN(dumpsize, sizeof(buf)));
                if (nr <= 0) {
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->johan 
Responsible-Changed-By: johan 
Responsible-Changed-When: Sun Apr 13 09:25:53 PDT 2003 
Responsible-Changed-Why:  
I'll take a look at this. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=39907 
State-Changed-From-To: open->closed 
State-Changed-By: johan 
State-Changed-When: Sun Apr 13 13:50:14 PDT 2003 
State-Changed-Why:  
savecore has been more or less completly rewritten 
hence this does not apply. 

Dan, thanks for doing this. I'm will commit the stuff  
that apply to current from your other PRs. 

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