From owner-svn-src-all@FreeBSD.ORG Mon Oct 13 16:17:43 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C97543B9; Mon, 13 Oct 2014 16:17:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B5E53B92; Mon, 13 Oct 2014 16:17:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s9DGHhTS027584; Mon, 13 Oct 2014 16:17:43 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9DGHh25027583; Mon, 13 Oct 2014 16:17:43 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201410131617.s9DGHh25027583@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 13 Oct 2014 16:17:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273048 - head/usr.bin/kdump X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 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: Mon, 13 Oct 2014 16:17:44 -0000 Author: jhb Date: Mon Oct 13 16:17:42 2014 New Revision: 273048 URL: https://svnweb.freebsd.org/changeset/base/273048 Log: Fix most of the warnings in kdump(1). Sponsored by: Norse Modified: head/usr.bin/kdump/kdump.c Modified: head/usr.bin/kdump/kdump.c ============================================================================== --- head/usr.bin/kdump/kdump.c Mon Oct 13 16:16:32 2014 (r273047) +++ head/usr.bin/kdump/kdump.c Mon Oct 13 16:17:42 2014 (r273048) @@ -103,9 +103,9 @@ void ktrgenio(struct ktr_genio *, int); void ktrpsig(struct ktr_psig *); void ktrcsw(struct ktr_csw *); void ktrcsw_old(struct ktr_csw_old *); -void ktruser_malloc(unsigned char *); -void ktruser_rtld(int, unsigned char *); -void ktruser(int, unsigned char *); +void ktruser_malloc(void *); +void ktruser_rtld(int, void *); +void ktruser(int, void *); void ktrcaprights(cap_rights_t *); void ktrsockaddr(struct sockaddr *); void ktrstat(struct stat *); @@ -122,10 +122,13 @@ void ioctlname(unsigned long, int); #define TIMESTAMP_ELAPSED 0x2 #define TIMESTAMP_RELATIVE 0x4 -int timestamp, decimal, fancy = 1, suppressdata, tail, threads, maxdata, +extern const char *signames[], *syscallnames[]; +extern int nsyscalls; + +static int timestamp, decimal, fancy = 1, suppressdata, tail, threads, maxdata, resolv = 0, abiflag = 0, syscallno = 0; -const char *tracefile = DEF_TRACEFILE; -struct ktr_header ktr_header; +static const char *tracefile = DEF_TRACEFILE; +static struct ktr_header ktr_header; #define TIME_FORMAT "%b %e %T %Y" #define eqs(s1, s2) (strcmp((s1), (s2)) == 0) @@ -172,7 +175,7 @@ struct proc_info pid_t pid; }; -TAILQ_HEAD(trace_procs, proc_info) trace_procs; +static TAILQ_HEAD(trace_procs, proc_info) trace_procs; #ifdef HAVE_LIBCAPSICUM static cap_channel_t *cappwd, *capgrp; @@ -456,7 +459,7 @@ limitfd(int fd) unsigned long cmd; cap_rights_init(&rights, CAP_FSTAT); - cmd = -1; + cmd = 0; switch (fd) { case STDIN_FILENO: @@ -479,7 +482,7 @@ limitfd(int fd) if (cap_rights_limit(fd, &rights) < 0 && errno != ENOSYS) err(1, "unable to limit rights for descriptor %d", fd); - if (cmd != -1 && cap_ioctls_limit(fd, &cmd, 1) < 0 && errno != ENOSYS) + if (cmd != 0 && cap_ioctls_limit(fd, &cmd, 1) < 0 && errno != ENOSYS) err(1, "unable to limit ioctls for descriptor %d", fd); } @@ -1093,7 +1096,7 @@ ktrsyscall(struct ktr_syscall *ktr, u_in print_number(ip, narg, c); putchar(','); flagsname(ip[0]); - printf(",0%o", ip[1]); + printf(",0%o", (unsigned int)ip[1]); ip += 3; narg -= 3; break; @@ -1515,9 +1518,10 @@ struct utrace_rtld { }; void -ktruser_rtld(int len, unsigned char *p) +ktruser_rtld(int len, void *p) { - struct utrace_rtld *ut = (struct utrace_rtld *)p; + struct utrace_rtld *ut = p; + unsigned char *cp; void *parent; int mode; @@ -1582,14 +1586,15 @@ ktruser_rtld(int len, unsigned char *p) ut->name); break; default: - p += 4; + cp = p; + cp += 4; len -= 4; printf("RTLD: %d ", len); while (len--) if (decimal) - printf(" %d", *p++); + printf(" %d", *cp++); else - printf(" %02x", *p++); + printf(" %02x", *cp++); printf("\n"); } } @@ -1601,9 +1606,9 @@ struct utrace_malloc { }; void -ktruser_malloc(unsigned char *p) +ktruser_malloc(void *p) { - struct utrace_malloc *ut = (struct utrace_malloc *)p; + struct utrace_malloc *ut = p; if (ut->p == (void *)(intptr_t)(-1)) printf("malloc_init()\n"); @@ -1616,8 +1621,9 @@ ktruser_malloc(unsigned char *p) } void -ktruser(int len, unsigned char *p) +ktruser(int len, void *p) { + unsigned char *cp; if (len >= 8 && bcmp(p, "RTLD", 4) == 0) { ktruser_rtld(len, p); @@ -1630,11 +1636,12 @@ ktruser(int len, unsigned char *p) } printf("%d ", len); + cp = p; while (len--) if (decimal) - printf(" %d", *p++); + printf(" %d", *cp++); else - printf(" %02x", *p++); + printf(" %02x", *cp++); printf("\n"); }