Source-Changes-HG archive

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

[src/trunk]: src/usr.sbin/mtree use uintmax_t for nlink_t from FreeBSD



details:   https://anonhg.NetBSD.org/src/rev/df43c27059e6
branches:  trunk
changeset: 828456:df43c27059e6
user:      christos <christos%NetBSD.org@localhost>
date:      Thu Dec 14 18:34:41 2017 +0000

description:
use uintmax_t for nlink_t from FreeBSD

diffstat:

 usr.sbin/mtree/create.c   |  7 ++++---
 usr.sbin/mtree/spec.c     |  7 ++++---
 usr.sbin/mtree/specspec.c |  6 +++---
 3 files changed, 11 insertions(+), 9 deletions(-)

diffs (83 lines):

diff -r 4b9075d7fadd -r df43c27059e6 usr.sbin/mtree/create.c
--- a/usr.sbin/mtree/create.c   Thu Dec 14 16:49:11 2017 +0000
+++ b/usr.sbin/mtree/create.c   Thu Dec 14 18:34:41 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: create.c,v 1.73 2014/04/24 17:22:41 christos Exp $     */
+/*     $NetBSD: create.c,v 1.74 2017/12/14 18:34:41 christos 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.73 2014/04/24 17:22:41 christos Exp $");
+__RCSID("$NetBSD: create.c,v 1.74 2017/12/14 18:34:41 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -224,7 +224,8 @@
                output(fp, indent, &offset, "device=%#jx",
                    (uintmax_t)p->fts_statp->st_rdev);
        if (keys & F_NLINK && p->fts_statp->st_nlink != 1)
-               output(fp, indent, &offset, "nlink=%u", p->fts_statp->st_nlink);
+               output(fp, indent, &offset, "nlink=%ju",
+                   (uintmax_t)p->fts_statp->st_nlink);
        if (keys & F_SIZE &&
            (flavor == F_FREEBSD9 || S_ISREG(p->fts_statp->st_mode)))
                output(fp, indent, &offset, "size=%ju",
diff -r 4b9075d7fadd -r df43c27059e6 usr.sbin/mtree/spec.c
--- a/usr.sbin/mtree/spec.c     Thu Dec 14 16:49:11 2017 +0000
+++ b/usr.sbin/mtree/spec.c     Thu Dec 14 18:34:41 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: spec.c,v 1.89 2014/04/24 17:22:41 christos Exp $       */
+/*     $NetBSD: spec.c,v 1.90 2017/12/14 18:34:41 christos Exp $       */
 
 /*-
  * Copyright (c) 1989, 1993
@@ -67,7 +67,7 @@
 #if 0
 static char sccsid[] = "@(#)spec.c     8.2 (Berkeley) 4/28/95";
 #else
-__RCSID("$NetBSD: spec.c,v 1.89 2014/04/24 17:22:41 christos Exp $");
+__RCSID("$NetBSD: spec.c,v 1.90 2017/12/14 18:34:41 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -363,7 +363,8 @@
                        appendfield(fp, pathlast, "device=%#jx",
                            (uintmax_t)cur->st_rdev);
                if (MATCHFLAG(F_NLINK))
-                       appendfield(fp, pathlast, "nlink=%d", cur->st_nlink);
+                       appendfield(fp, pathlast, "nlink=%ju",
+                           (uintmax_t)cur->st_nlink);
                if (MATCHFLAG(F_SLINK))
                        appendfield(fp, pathlast, "link=%s",
                            vispath(cur->slink));
diff -r 4b9075d7fadd -r df43c27059e6 usr.sbin/mtree/specspec.c
--- a/usr.sbin/mtree/specspec.c Thu Dec 14 16:49:11 2017 +0000
+++ b/usr.sbin/mtree/specspec.c Thu Dec 14 18:34:41 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: specspec.c,v 1.3 2015/01/07 20:50:36 joerg Exp $       */
+/*     $NetBSD: specspec.c,v 1.4 2017/12/14 18:34:41 christos Exp $    */
 
 /*-
  * Copyright (c) 2003 Poul-Henning Kamp
@@ -31,7 +31,7 @@
 #endif
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: specspec.c,v 1.3 2015/01/07 20:50:36 joerg Exp $");
+__RCSID("$NetBSD: specspec.c,v 1.4 2017/12/14 18:34:41 christos Exp $");
 
 #include <err.h>
 #include <grp.h>
@@ -73,7 +73,7 @@
        if (f & F_MODE)
                printf(" mode=%o", n->st_mode);
        if (f & F_NLINK)
-               printf(" nlink=%d", (int)n->st_nlink);
+               printf(" nlink=%ju", (uintmax_t)n->st_nlink);
        if (f & F_SIZE)
                printf(" size=%jd", (intmax_t)n->st_size);
        if (f & F_UID)



Home | Main Index | Thread Index | Old Index