summaryrefslogtreecommitdiffstats
path: root/usr.bin/kdump/kdump.c
diff options
context:
space:
mode:
authordes <des@FreeBSD.org>2011-10-08 12:47:00 +0000
committerdes <des@FreeBSD.org>2011-10-08 12:47:00 +0000
commit0d23c50594a57a81eb8c0b7f952ee2612cf56220 (patch)
tree0c5de37367cc311a02ca5d4bc6cea313823170e1 /usr.bin/kdump/kdump.c
parenta011c99980aa09ec857ee5006943c95bfce6a95b (diff)
downloadFreeBSD-src-0d23c50594a57a81eb8c0b7f952ee2612cf56220.zip
FreeBSD-src-0d23c50594a57a81eb8c0b7f952ee2612cf56220.tar.gz
Bring ioctlname() in line with all the other *name() functions, which
actually print the name (or the numeric value, if they can't figure out the correct name) instead of just returning a pointer to it. Also, since ioctl numbers are not and probably never will be unique, drop support for using a switch statement instead of an if/else chain.
Diffstat (limited to 'usr.bin/kdump/kdump.c')
-rw-r--r--usr.bin/kdump/kdump.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/usr.bin/kdump/kdump.c b/usr.bin/kdump/kdump.c
index 243b375..0cd31bc 100644
--- a/usr.bin/kdump/kdump.c
+++ b/usr.bin/kdump/kdump.c
@@ -100,7 +100,7 @@ void ktrsockaddr(struct sockaddr *);
void ktrstat(struct stat *);
void ktrstruct(char *, size_t);
void usage(void);
-const char *ioctlname(u_long);
+void ioctlname(unsigned long, int);
int timestamp, decimal, fancy = 1, suppressdata, tail, threads, maxdata,
resolv = 0, abiflag = 0;
@@ -504,14 +504,8 @@ ktrsyscall(struct ktr_syscall *ktr, u_int flags)
case SYS_ioctl: {
const char *cp;
print_number(ip, narg, c);
- if ((cp = ioctlname(*ip)) != NULL)
- printf(",%s", cp);
- else {
- if (decimal)
- printf(",%jd", (intmax_t)*ip);
- else
- printf(",%#jx ", (intmax_t)*ip);
- }
+ putchar(c);
+ ioctlname(*ip, decimal);
c = ',';
ip++;
narg--;
OpenPOWER on IntegriCloud