Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 27 Jun 2002 02:01:51 +0200 (CEST)
From:      Dan Lukes <dan@obluda.cz>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   bin/39905: cleaning sbin/restore code from warnings
Message-ID:  <200206270001.g5R01pPT060838@obluda.cz>

next in thread | raw e-mail | index | archive | help

>Number:         39905
>Category:       bin
>Synopsis:       cleaning sbin/restore code from warnings
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jun 26 17:50:01 PDT 2002
>Closed-Date:
>Last-Modified:
>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:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200206270001.g5R01pPT060838>