summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2012-10-27 18:50:44 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2012-10-27 18:50:44 +0000
commit03c2da2f244bd05805b6ca92f05616eb6dd95a34 (patch)
tree9bf781e975a37d7bcc6efaba5e861469b6a91b7d
parenta1ce5fd60b5bd673846b158bf5be6128178aba37 (diff)
Only print debug output if explicitly requested.
-rw-r--r--usr.sbin/ldomctl/util.c4
-rw-r--r--usr.sbin/ldomctl/util.h5
2 files changed, 6 insertions, 3 deletions
diff --git a/usr.sbin/ldomctl/util.c b/usr.sbin/ldomctl/util.c
index cff44ee1b95..e2c3213b53d 100644
--- a/usr.sbin/ldomctl/util.c
+++ b/usr.sbin/ldomctl/util.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: util.c,v 1.1 2012/10/21 12:56:45 kettenis Exp $ */
+/* $OpenBSD: util.c,v 1.2 2012/10/27 18:50:43 kettenis Exp $ */
/*
* Copyright (c) 2012 Mark Kettenis
@@ -22,6 +22,8 @@
#include "util.h"
+int debug;
+
void *
xmalloc(size_t size)
{
diff --git a/usr.sbin/ldomctl/util.h b/usr.sbin/ldomctl/util.h
index e46dfb8b028..51b6681480d 100644
--- a/usr.sbin/ldomctl/util.h
+++ b/usr.sbin/ldomctl/util.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: util.h,v 1.1 2012/10/21 12:56:45 kettenis Exp $ */
+/* $OpenBSD: util.h,v 1.2 2012/10/27 18:50:43 kettenis Exp $ */
/*
* Copyright (c) 2012 Mark Kettenis
@@ -18,7 +18,8 @@
#include <stddef.h>
-#define DPRINTF(x) printf x
+extern int debug;
+#define DPRINTF(x) if (debug) printf x
void *xmalloc(size_t);
void *xzalloc(size_t);