From owner-svn-src-all@FreeBSD.ORG Sat Feb 6 16:01:39 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3A830106566C; Sat, 6 Feb 2010 16:01:39 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2AF7F8FC08; Sat, 6 Feb 2010 16:01:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o16G1dWS070863; Sat, 6 Feb 2010 16:01:39 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o16G1dYx070861; Sat, 6 Feb 2010 16:01:39 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201002061601.o16G1dYx070861@svn.freebsd.org> From: Jaakko Heinonen Date: Sat, 6 Feb 2010 16:01:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203551 - head/usr.bin/kdump X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Feb 2010 16:01:39 -0000 Author: jh Date: Sat Feb 6 16:01:38 2010 New Revision: 203551 URL: http://svn.freebsd.org/changeset/base/203551 Log: - Cast intptr_t, pid_t and time_t values to intmax_t and use %jd with printf. - Cast the system call return value to long and use %ld in a printf in ktrsysret(). PR: bin/123774 MFC after: 2 weeks Modified: head/usr.bin/kdump/kdump.c Modified: head/usr.bin/kdump/kdump.c ============================================================================== --- head/usr.bin/kdump/kdump.c Sat Feb 6 15:32:42 2010 (r203550) +++ head/usr.bin/kdump/kdump.c Sat Feb 6 16:01:38 2010 (r203551) @@ -182,14 +182,16 @@ main(int argc, char *argv[]) if (ktr_header.ktr_type & KTR_DROP) { ktr_header.ktr_type &= ~KTR_DROP; if (!drop_logged && threads) { - (void)printf("%6d %6d %-8.*s Events dropped.\n", - ktr_header.ktr_pid, ktr_header.ktr_tid > - 0 ? ktr_header.ktr_tid : 0, MAXCOMLEN, - ktr_header.ktr_comm); + (void)printf( + "%6jd %6jd %-8.*s Events dropped.\n", + (intmax_t)ktr_header.ktr_pid, + ktr_header.ktr_tid > 0 ? + (intmax_t)ktr_header.ktr_tid : 0, + MAXCOMLEN, ktr_header.ktr_comm); drop_logged = 1; } else if (!drop_logged) { - (void)printf("%6d %-8.*s Events dropped.\n", - ktr_header.ktr_pid, MAXCOMLEN, + (void)printf("%6jd %-8.*s Events dropped.\n", + (intmax_t)ktr_header.ktr_pid, MAXCOMLEN, ktr_header.ktr_comm); drop_logged = 1; } @@ -309,10 +311,11 @@ dumpheader(struct ktr_header *kth) * negative tid's as 0. */ if (threads) - (void)printf("%6d %6d %-8.*s ", kth->ktr_pid, kth->ktr_tid > - 0 ? kth->ktr_tid : 0, MAXCOMLEN, kth->ktr_comm); + (void)printf("%6jd %6jd %-8.*s ", (intmax_t)kth->ktr_pid, + kth->ktr_tid > 0 ? (intmax_t)kth->ktr_tid : 0, + MAXCOMLEN, kth->ktr_comm); else - (void)printf("%6d %-8.*s ", kth->ktr_pid, MAXCOMLEN, + (void)printf("%6jd %-8.*s ", (intmax_t)kth->ktr_pid, MAXCOMLEN, kth->ktr_comm); if (timestamp) { if (timestamp == 3) { @@ -325,8 +328,8 @@ dumpheader(struct ktr_header *kth) timevalsub(&kth->ktr_time, &prevtime); prevtime = temp; } - (void)printf("%ld.%06ld ", - kth->ktr_time.tv_sec, kth->ktr_time.tv_usec); + (void)printf("%jd.%06ld ", (intmax_t)kth->ktr_time.tv_sec, + kth->ktr_time.tv_usec); } (void)printf("%s ", type); } @@ -821,7 +824,7 @@ ktrsysret(struct ktr_sysret *ktr) if (error == 0) { if (fancy) { - (void)printf("%d", ret); + (void)printf("%ld", (long)ret); if (ret < 0 || ret > 9) (void)printf("/%#lx", (long)ret); } else { @@ -1267,7 +1270,7 @@ ktrstat(struct stat *statp) printf("rdev=%ju, ", (uintmax_t)statp->st_rdev); printf("atime="); if (resolv == 0) - printf("%ld", statp->st_atimespec.tv_sec); + printf("%jd", (intmax_t)statp->st_atimespec.tv_sec); else { tm = localtime(&statp->st_atimespec.tv_sec); (void)strftime(timestr, sizeof(timestr), TIME_FORMAT, tm); @@ -1279,7 +1282,7 @@ ktrstat(struct stat *statp) printf(", "); printf("stime="); if (resolv == 0) - printf("%ld", statp->st_mtimespec.tv_sec); + printf("%jd", (intmax_t)statp->st_mtimespec.tv_sec); else { tm = localtime(&statp->st_mtimespec.tv_sec); (void)strftime(timestr, sizeof(timestr), TIME_FORMAT, tm); @@ -1291,7 +1294,7 @@ ktrstat(struct stat *statp) printf(", "); printf("ctime="); if (resolv == 0) - printf("%ld", statp->st_ctimespec.tv_sec); + printf("%jd", (intmax_t)statp->st_ctimespec.tv_sec); else { tm = localtime(&statp->st_ctimespec.tv_sec); (void)strftime(timestr, sizeof(timestr), TIME_FORMAT, tm); @@ -1303,7 +1306,7 @@ ktrstat(struct stat *statp) printf(", "); printf("birthtime="); if (resolv == 0) - printf("%ld", statp->st_birthtimespec.tv_sec); + printf("%jd", (intmax_t)statp->st_birthtimespec.tv_sec); else { tm = localtime(&statp->st_birthtimespec.tv_sec); (void)strftime(timestr, sizeof(timestr), TIME_FORMAT, tm);