From 1b32e38e4fb531e26eaf29d5df1755323646d2b7 Mon Sep 17 00:00:00 2001 From: phk Date: Wed, 2 Oct 2002 07:48:39 +0000 Subject: Put some failing ioctl related printfs under a suitable debug flag. Sponsored by: DARPA & NAI Labs. --- sys/geom/geom_dev.c | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) (limited to 'sys/geom/geom_dev.c') diff --git a/sys/geom/geom_dev.c b/sys/geom/geom_dev.c index 3ad246e..55abe74 100644 --- a/sys/geom/geom_dev.c +++ b/sys/geom/geom_dev.c @@ -301,18 +301,20 @@ g_dev_ioctl(dev_t dev, u_long cmd, caddr_t data, int fflag, struct thread *td) PICKUP_GIANT(); g_waitidle(); if (error == ENOIOCTL) { - i = IOCGROUP(cmd); - printf("IOCTL(0x%lx) \"%s\"", cmd, gp->name); - if (i > ' ' && i <= '~') - printf(" '%c'", (int)IOCGROUP(cmd)); - else - printf(" 0x%lx", IOCGROUP(cmd)); - printf("/%ld ", cmd & 0xff); - if (cmd & IOC_IN) - printf("I"); - if (cmd & IOC_OUT) - printf("O"); - printf("(%ld) = ENOIOCTL\n", IOCPARM_LEN(cmd)); + if (g_debugflags & G_T_TOPOLOGY) { + i = IOCGROUP(cmd); + printf("IOCTL(0x%lx) \"%s\"", cmd, gp->name); + if (i > ' ' && i <= '~') + printf(" '%c'", (int)IOCGROUP(cmd)); + else + printf(" 0x%lx", IOCGROUP(cmd)); + printf("/%ld ", cmd & 0xff); + if (cmd & IOC_IN) + printf("I"); + if (cmd & IOC_OUT) + printf("O"); + printf("(%ld) = ENOIOCTL\n", IOCPARM_LEN(cmd)); + } error = ENOTTY; } return (error); -- cgit v1.1