summaryrefslogtreecommitdiffstats
path: root/contrib/mtree/create.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/mtree/create.c')
-rw-r--r--contrib/mtree/create.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/contrib/mtree/create.c b/contrib/mtree/create.c
index 10306f9..516977e 100644
--- a/contrib/mtree/create.c
+++ b/contrib/mtree/create.c
@@ -1,4 +1,4 @@
-/* $NetBSD: create.c,v 1.69 2013/02/03 19:15:17 christos Exp $ */
+/* $NetBSD: create.c,v 1.71 2013/10/16 17:24:20 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.69 2013/02/03 19:15:17 christos Exp $");
+__RCSID("$NetBSD: create.c,v 1.71 2013/10/16 17:24:20 christos Exp $");
#endif
#endif /* not lint */
@@ -53,6 +53,7 @@ __RCSID("$NetBSD: create.c,v 1.69 2013/02/03 19:15:17 christos Exp $");
#include <fcntl.h>
#include <grp.h>
#include <pwd.h>
+#include <stdint.h>
#include <stdio.h>
#include <stdarg.h>
#include <stdlib.h>
@@ -216,22 +217,22 @@ statf(int indent, FTSENT *p)
p->fts_statp->st_mode & MBITS);
if (keys & F_DEV &&
(S_ISBLK(p->fts_statp->st_mode) || S_ISCHR(p->fts_statp->st_mode)))
- output(indent, &offset, "device=%#llx",
- (long long)p->fts_statp->st_rdev);
+ output(indent, &offset, "device=%#jx",
+ (uintmax_t)p->fts_statp->st_rdev);
if (keys & F_NLINK && p->fts_statp->st_nlink != 1)
output(indent, &offset, "nlink=%u", p->fts_statp->st_nlink);
if (keys & F_SIZE &&
- (flavor != F_NETBSD6 || S_ISREG(p->fts_statp->st_mode)))
- output(indent, &offset, "size=%lld",
- (long long)p->fts_statp->st_size);
+ (flavor == F_FREEBSD9 || S_ISREG(p->fts_statp->st_mode)))
+ output(indent, &offset, "size=%ju",
+ (uintmax_t)p->fts_statp->st_size);
if (keys & F_TIME)
#if defined(BSD4_4) && !defined(HAVE_NBTOOL_CONFIG_H)
- output(indent, &offset, "time=%ld.%09ld",
- (long)p->fts_statp->st_mtimespec.tv_sec,
+ output(indent, &offset, "time=%jd.%09ld",
+ (intmax_t)p->fts_statp->st_mtimespec.tv_sec,
p->fts_statp->st_mtimespec.tv_nsec);
#else
- output(indent, &offset, "time=%ld.%09ld",
- (long)p->fts_statp->st_mtime, (long)0);
+ output(indent, &offset, "time=%jd.%09ld",
+ (intmax_t)p->fts_statp->st_mtime, (long)0);
#endif
if (keys & F_CKSUM && S_ISREG(p->fts_statp->st_mode)) {
if ((fd = open(p->fts_accpath, O_RDONLY, 0)) < 0 ||
OpenPOWER on IntegriCloud