fix dev_t 64 bit issues.

This commit is contained in:
christos 2008-12-28 19:50:22 +00:00
parent 7bf2b3b453
commit a5c6617db7
2 changed files with 9 additions and 8 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: print.c,v 1.106 2008/10/19 02:39:08 christos Exp $ */
/* $NetBSD: print.c,v 1.107 2008/12/28 19:50:22 christos Exp $ */
/*
* Copyright (c) 2000, 2007 The NetBSD Foundation, Inc.
@ -63,7 +63,7 @@
#if 0
static char sccsid[] = "@(#)print.c 8.6 (Berkeley) 4/16/94";
#else
__RCSID("$NetBSD: print.c,v 1.106 2008/10/19 02:39:08 christos Exp $");
__RCSID("$NetBSD: print.c,v 1.107 2008/12/28 19:50:22 christos Exp $");
#endif
#endif /* not lint */
@ -718,7 +718,7 @@ tdev(void *arg, VARENT *ve, int mode)
v->width = 2;
} else {
(void)snprintf(buff, sizeof(buff),
"%d/%d", major(dev), minor(dev));
"%lld/%lld", (long long)major(dev), (long long)minor(dev));
strprintorsetwidth(v, buff, mode);
}
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: ps.c,v 1.71 2008/09/26 13:02:42 wiz Exp $ */
/* $NetBSD: ps.c,v 1.72 2008/12/28 19:50:22 christos Exp $ */
/*
* Copyright (c) 2000-2008 The NetBSD Foundation, Inc.
@ -68,7 +68,7 @@ __COPYRIGHT("@(#) Copyright (c) 1990, 1993, 1994\
#if 0
static char sccsid[] = "@(#)ps.c 8.4 (Berkeley) 4/2/94";
#else
__RCSID("$NetBSD: ps.c,v 1.71 2008/09/26 13:02:42 wiz Exp $");
__RCSID("$NetBSD: ps.c,v 1.72 2008/12/28 19:50:22 christos Exp $");
#endif
#endif /* not lint */
@ -152,7 +152,8 @@ main(int argc, char *argv[])
struct varent *vent;
struct winsize ws;
struct kinfo_lwp *kl, *l;
int ch, flag, i, j, fmt, lineno, nentries, nlwps;
int ch, i, j, fmt, lineno, nentries, nlwps;
long long flag;
int prtheader, wflag, what, xflg, mode, showlwps;
char *nlistf, *memf, *swapf, errbuf[_POSIX2_LINE_MAX];
char *ttname;
@ -414,7 +415,7 @@ main(int argc, char *argv[])
for (i = 0; i < nentries; i++) {
struct kinfo_proc2 *ki = &kinfo[i];
if (xflg == 0 && (ki->p_tdev == NODEV ||
if (xflg == 0 && (ki->p_tdev == (uint32_t)NODEV ||
(ki->p_flag & P_CONTROLT) == 0))
continue;
@ -450,7 +451,7 @@ main(int argc, char *argv[])
for (i = lineno = 0; i < nentries; i++) {
struct kinfo_proc2 *ki = &kinfo[i];
if (xflg == 0 && (ki->p_tdev == NODEV ||
if (xflg == 0 && (ki->p_tdev == (uint32_t)NODEV ||
(ki->p_flag & P_CONTROLT ) == 0))
continue;
kl = kvm_getlwps(kd, ki->p_pid, (u_long)ki->p_paddr,