Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.sbin/mtree complete WARNS=2 cleanup (with a bit of ickin...



details:   https://anonhg.NetBSD.org/src/rev/20b97612794c
branches:  trunk
changeset: 516178:20b97612794c
user:      lukem <lukem%NetBSD.org@localhost>
date:      Thu Oct 18 05:06:01 2001 +0000

description:
complete WARNS=2 cleanup (with a bit of ickiness for the fts_open argv issue)

diffstat:

 usr.sbin/mtree/Makefile |   3 ++-
 usr.sbin/mtree/create.c |  10 +++++-----
 usr.sbin/mtree/verify.c |   9 ++++-----
 3 files changed, 11 insertions(+), 11 deletions(-)

diffs (86 lines):

diff -r 02d0c3033ed7 -r 20b97612794c usr.sbin/mtree/Makefile
--- a/usr.sbin/mtree/Makefile   Thu Oct 18 04:45:41 2001 +0000
+++ b/usr.sbin/mtree/Makefile   Thu Oct 18 05:06:01 2001 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.18 2001/10/09 05:19:03 enami Exp $
+#      $NetBSD: Makefile,v 1.19 2001/10/18 05:06:01 lukem Exp $
 #      from: @(#)Makefile      8.2 (Berkeley) 4/27/95
 
 PROG=  mtree
@@ -6,6 +6,7 @@
 MAN=   mtree.8
 SRCS=  compare.c crc.c create.c misc.c mtree.c spec.c verify.c \
        stat_flags.c pack_dev.c
+WARNS?=        2
 
 LDADD+=        -lutil
 DPADD+=        ${LIBUTIL}
diff -r 02d0c3033ed7 -r 20b97612794c usr.sbin/mtree/create.c
--- a/usr.sbin/mtree/create.c   Thu Oct 18 04:45:41 2001 +0000
+++ b/usr.sbin/mtree/create.c   Thu Oct 18 05:06:01 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: create.c,v 1.33 2001/10/18 04:37:56 lukem Exp $        */
+/*     $NetBSD: create.c,v 1.34 2001/10/18 05:06:02 lukem Exp $        */
 
 /*-
  * Copyright (c) 1989, 1993
@@ -38,7 +38,7 @@
 #if 0
 static char sccsid[] = "@(#)create.c   8.1 (Berkeley) 6/6/93";
 #else
-__RCSID("$NetBSD: create.c,v 1.33 2001/10/18 04:37:56 lukem Exp $");
+__RCSID("$NetBSD: create.c,v 1.34 2001/10/18 05:06:02 lukem Exp $");
 #endif
 #endif /* not lint */
 
@@ -85,7 +85,9 @@
        FTS *t;
        FTSENT *p;
        time_t clocktime;
-       char *argv[2], host[MAXHOSTNAMELEN + 1];
+       char host[MAXHOSTNAMELEN + 1];
+       char  dot[] = ".";              /* XXX: work around gcc warning */
+       char *argv[] = { dot, NULL };
 
        (void)time(&clocktime);
        (void)gethostname(host, sizeof(host));
@@ -94,8 +96,6 @@
            "#\t   user: %s\n#\tmachine: %s\n#\t   tree: %s\n#\t   date: %s",
            getlogin(), host, fullpath, ctime(&clocktime));
 
-       argv[0] = ".";
-       argv[1] = NULL;
        if ((t = fts_open(argv, ftsoptions, dsort)) == NULL)
                mtree_err("fts_open: %s", strerror(errno));
        while ((p = fts_read(t)) != NULL)
diff -r 02d0c3033ed7 -r 20b97612794c usr.sbin/mtree/verify.c
--- a/usr.sbin/mtree/verify.c   Thu Oct 18 04:45:41 2001 +0000
+++ b/usr.sbin/mtree/verify.c   Thu Oct 18 05:06:01 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: verify.c,v 1.20 2001/10/09 04:50:01 lukem Exp $        */
+/*     $NetBSD: verify.c,v 1.21 2001/10/18 05:06:02 lukem Exp $        */
 
 /*-
  * Copyright (c) 1990, 1993
@@ -38,7 +38,7 @@
 #if 0
 static char sccsid[] = "@(#)verify.c   8.1 (Berkeley) 6/6/93";
 #else
-__RCSID("$NetBSD: verify.c,v 1.20 2001/10/09 04:50:01 lukem Exp $");
+__RCSID("$NetBSD: verify.c,v 1.21 2001/10/18 05:06:02 lukem Exp $");
 #endif
 #endif /* not lint */
 
@@ -79,10 +79,9 @@
        FTSENT *p;
        NODE *ep, *level;
        int ftsdepth, specdepth, rval;
-       char *argv[2];
+       char  dot[] = ".";              /* XXX: work around gcc warning */
+       char *argv[] = { dot, NULL };
 
-       argv[0] = ".";
-       argv[1] = NULL;
        if ((t = fts_open(argv, ftsoptions, NULL)) == NULL)
                mtree_err("fts_open: %s", strerror(errno));
        level = root;



Home | Main Index | Thread Index | Old Index