Module Name:    src
Committed By:   christos
Date:           Thu Dec 14 18:34:41 UTC 2017

Modified Files:
        src/usr.sbin/mtree: create.c spec.c specspec.c

Log Message:
use uintmax_t for nlink_t from FreeBSD


To generate a diff of this commit:
cvs rdiff -u -r1.73 -r1.74 src/usr.sbin/mtree/create.c
cvs rdiff -u -r1.89 -r1.90 src/usr.sbin/mtree/spec.c
cvs rdiff -u -r1.3 -r1.4 src/usr.sbin/mtree/specspec.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/mtree/create.c
diff -u src/usr.sbin/mtree/create.c:1.73 src/usr.sbin/mtree/create.c:1.74
--- src/usr.sbin/mtree/create.c:1.73	Thu Apr 24 13:22:41 2014
+++ src/usr.sbin/mtree/create.c	Thu Dec 14 13:34:41 2017
@@ -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 @@ statf(FILE *fp, int indent, FTSENT *p)
 		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",

Index: src/usr.sbin/mtree/spec.c
diff -u src/usr.sbin/mtree/spec.c:1.89 src/usr.sbin/mtree/spec.c:1.90
--- src/usr.sbin/mtree/spec.c:1.89	Thu Apr 24 13:22:41 2014
+++ src/usr.sbin/mtree/spec.c	Thu Dec 14 13:34:41 2017
@@ -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 @@ dump_nodes(FILE *fp, const char *dir, NO
 			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));

Index: src/usr.sbin/mtree/specspec.c
diff -u src/usr.sbin/mtree/specspec.c:1.3 src/usr.sbin/mtree/specspec.c:1.4
--- src/usr.sbin/mtree/specspec.c:1.3	Wed Jan  7 15:50:36 2015
+++ src/usr.sbin/mtree/specspec.c	Thu Dec 14 13:34:41 2017
@@ -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 @@ shownode(NODE *n, int f, char const *pat
 	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)

Reply via email to