From dan@obluda.cz  Wed Jun 26 17:42:22 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 D926E37D0DD
	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 g5R0bVTv061818
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 27 Jun 2002 02:37:31 +0200 (CEST)
	(envelope-from dan@obluda.cz)
Received: (from dan@localhost)
	by obluda.cz (8.12.4/8.12.4/Submit) id g5R01pPT060838;
	Thu, 27 Jun 2002 02:01:51 +0200 (CEST)
Message-Id: <200206270001.g5R01pPT060838@obluda.cz>
Date: Thu, 27 Jun 2002 02:01:51 +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/restore code from warnings
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         39905
>Category:       bin
>Synopsis:       [patch] cleaning restore(8) code from warnings
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jun 26 17:50:01 PDT 2002
>Closed-Date:    Fri May 23 19:18:23 UTC 2008
>Last-Modified:  Fri May 23 19:20:01 UTC 2008
>Originator:     Dan Lukes
>Release:        FreeBSD 4.6-STABLE i386
>Organization:
Obludarium
>Environment:
System: FreeBSD xkulesh.vol.cz 4.6-STABLE FreeBSD
src/sbin/restore/dirs.c,v 1.14.2.5 2001/10/15 13:44:45
src/sbin/restore/tape.c,v 1.16.2.7 2002/03/01 21:32:28

>Description:

sbin/restore/dirs.c: In function `extractdirs':
154: warning: int format, time_t arg (arg 4)
167: warning: int format, time_t arg (arg 4)
/usr/src/sbin/restore/dirs.c: In function `setdirmodes':
605: warning: int format, time_t arg (arg 4)

   time_t is _BSD_TIME_T e.g. long

sbin/restore/tape.c: In function `newtapebuf':
167: warning: type defaults to `int' in declaration of `tapebufsize'
   it cost nothing to write explicit `int' declaration

sbin/restore/tape.c: In function `getvol':
405: warning: long int format, int32_t arg (arg 3)
426: warning: long int format, daddr_t arg (arg 4)
   daddr_t is int32_t, int32_t is int 

sbin/restore/tape.c: In function `printdumpinfo':
523: warning: long int format, int32_t arg (arg 3)

sbin/restore/tape.c: In function `accthdr':
1177: warning: long int format, int32_t arg (arg 3)


>How-To-Repeat:
        N/A
>Fix:
--- sbin/restore/dirs.c.ORIG Sun Oct 28 01:07:09 2001
+++ sbin/restore/dirs.c      Thu Jun 27 00:38:56 2002
@@ -151,7 +151,7 @@
        vprintf(stdout, "Extract directories from tape\n");
        if ((tmpdir = getenv("TMPDIR")) == NULL || tmpdir[0] == '\0')
                tmpdir = _PATH_TMP;
-       (void) sprintf(dirfile, "%s/rstdir%d", tmpdir, dumpdate);
+       (void) sprintf(dirfile, "%s/rstdir%ld", tmpdir, dumpdate);
        if (command != 'r' && command != 'R') {
                (void *) strcat(dirfile, "-XXXXXX");
                fd = mkstemp(dirfile);
@@ -164,7 +164,7 @@
                done(1);
        }
        if (genmode != 0) {
-               (void) sprintf(modefile, "%s/rstmode%d", tmpdir, dumpdate);
+               (void) sprintf(modefile, "%s/rstmode%ld", tmpdir, dumpdate);
                if (command != 'r' && command != 'R') {
                        (void *) strcat(modefile, "-XXXXXX");
                        fd = mkstemp(modefile);
@@ -602,7 +602,7 @@
        if ((tmpdir = getenv("TMPDIR")) == NULL || tmpdir[0] == '\0')
                tmpdir = _PATH_TMP;
        if (command == 'r' || command == 'R')
-               (void) sprintf(modefile, "%s/rstmode%d", tmpdir, dumpdate);
+               (void) sprintf(modefile, "%s/rstmode%ld", tmpdir, dumpdate);
        if (modefile[0] == '#') {
                panic("modefile not defined\n");
                fprintf(stderr, "directory mode, owner, and times not set\n");
--- sbin/restore/tape.c.ORIG Sat Mar  2 14:43:03 2002
+++ sbin/restore/tape.c      Thu Jun 27 01:57:52 2002
@@ -164,7 +164,7 @@
 newtapebuf(size)
        long size;
 {
-       static tapebufsize = -1;
+       static int tapebufsize = -1;
        ntrec = size;
        if (size <= tapebufsize)
@@ -402,7 +402,7 @@
                goto again;
        }
        if (tmpbuf.c_volume != volno) {
-               fprintf(stderr, "Wrong volume (%ld)\n", tmpbuf.c_volume);
+               fprintf(stderr, "Wrong volume (%d)\n", tmpbuf.c_volume);
                volno = 0;
                goto again;
        }
@@ -422,7 +422,7 @@
         * If coming to this volume at random, skip to the beginning
         * of the next record.
         */
-       dprintf(stdout, "last rec %ld, tape starts with %ld\n", prevtapea,
+       dprintf(stdout, "last rec %ld, tape starts with %d\n", prevtapea,
            tmpbuf.c_tapea);
        if (tmpbuf.c_type == TS_TAPE && (tmpbuf.c_flags & DR_NEWHEADER)) {
                if (curfile.action != USING) {
@@ -519,7 +519,7 @@
            (spcl.c_ddate == 0) ? "the epoch\n" : ctime(&spcl.c_ddate));
        if (spcl.c_host[0] == '\0')
                return;
-       fprintf(stderr, "Level %ld dump of %s on %s:%s\n",
+       fprintf(stderr, "Level %d dump of %s on %s:%s\n",
                spcl.c_level, spcl.c_filesys, spcl.c_host, spcl.c_dev);
        fprintf(stderr, "Label: %s\n", spcl.c_label);
 }
@@ -1173,7 +1173,7 @@
                fprintf(stderr, "Volume header (%s inode format) ",
                    oldinofmt ? "old" : "new");
                if (header->c_firstrec)
-                       fprintf(stderr, "begins with record %ld",
+                       fprintf(stderr, "begins with record %d",
                                header->c_firstrec);
                fprintf(stderr, "\n");
                previno = 0x7fffffff;
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->johan 
Responsible-Changed-By: johan 
Responsible-Changed-When: Sun Apr 13 09:25:25 PDT 2003 
Responsible-Changed-Why:  
I'll take a look at this. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=39905 
Responsible-Changed-From-To: johan->freebsd-bugs 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Mon Aug 13 15:57:31 UTC 2007 
Responsible-Changed-Why:  
johan@ states that he does not have much time to work on FreeBSD at the 
moment, so return this one to the pool. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=39905 
State-Changed-From-To: open->closed 
State-Changed-By: mckusick 
State-Changed-When: Fri May 23 19:17:41 UTC 2008 
State-Changed-Why:  
All remaining reported nits have been fixed. 

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

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/39905: commit references a PR
Date: Fri, 23 May 2008 19:17:14 +0000 (UTC)

 mckusick    2008-05-23 19:17:08 UTC
 
   FreeBSD src repository
 
   Modified files:
     sbin/restore         dirs.c 
   Log:
   Fix nits pointed out in PR bin/39905 that have not already been
   corrected since it was filed. With this change the PR will be closed.
   
   PR:     bin/39905
   
   Revision  Changes    Path
   1.35      +3 -3      src/sbin/restore/dirs.c
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
>Unformatted:
