summaryrefslogtreecommitdiffstats
path: root/sbin
diff options
context:
space:
mode:
authorgrog <grog@FreeBSD.org>2001-05-23 05:22:19 +0000
committergrog <grog@FreeBSD.org>2001-05-23 05:22:19 +0000
commit4bcc31e369167044056e03ec3b2f726b37d4d101 (patch)
tree1a50d2aebbcb2913902b72d75fc04d830b2eb70f /sbin
parent8e11e4930364adece1d4c680a37dcbaf7ff7f413 (diff)
downloadFreeBSD-src-4bcc31e369167044056e03ec3b2f726b37d4d101.zip
FreeBSD-src-4bcc31e369167044056e03ec3b2f726b37d4d101.tar.gz
vinum_debug: Check for kernel module debug support, print error
message if not present.
Diffstat (limited to 'sbin')
-rw-r--r--sbin/vinum/commands.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/sbin/vinum/commands.c b/sbin/vinum/commands.c
index 4c501c7..e9adc2f 100644
--- a/sbin/vinum/commands.c
+++ b/sbin/vinum/commands.c
@@ -202,22 +202,23 @@ vinum_read(int argc, char *argv[], char *arg0[])
checkupdates(); /* make sure we're updating */
}
-#ifdef VINUMDEBUG
void
vinum_debug(int argc, char *argv[], char *arg0[])
{
struct debuginfo info;
- if (argc > 0) {
- info.param = atoi(argv[0]);
- info.changeit = 1;
- } else {
- info.changeit = 0;
- sleep(2); /* give a chance to leave the window */
- }
- ioctl(superdev, VINUM_DEBUG, (caddr_t) & info);
+ if (vinum_conf.flags & VF_HASDEBUG) {
+ if (argc > 0) {
+ info.param = atoi(argv[0]);
+ info.changeit = 1;
+ } else {
+ info.changeit = 0;
+ sleep(2); /* give a chance to leave the window */
+ }
+ ioctl(superdev, VINUM_DEBUG, (caddr_t) & info);
+ } else /* no debug in kernel module */
+ fprintf(stderr, "Kernel module does not have debug support\n");
}
-#endif
void
vinum_modify(int argc, char *argv[], char *arg0[])
OpenPOWER on IntegriCloud