diff options
-rw-r--r-- | cgrulesengd.h | 4 | ||||
-rw-r--r-- | libcgroup-internal.h | 6 | ||||
-rw-r--r-- | libcgroup.h | 6 | ||||
-rw-r--r-- | tools-common.h | 7 |
4 files changed, 14 insertions, 9 deletions
diff --git a/cgrulesengd.h b/cgrulesengd.h index f49f79f..1dc5bda 100644 --- a/cgrulesengd.h +++ b/cgrulesengd.h @@ -32,9 +32,9 @@ __BEGIN_DECLS /* A simple macro for printing messages only when CGROUP_DEBUG is defined. */ #ifdef CGROUP_DEBUG - #define fdbg(a, b...) fprintf(a, b) + #define dbg(a...) printf(a) #else - #define fdbg(a, b...) do {} while(0) + #define dbg(a...) do {} while (0) #endif /* CGROUP_DEBUG */ /* The following ten macros are all for the Netlink code. */ diff --git a/libcgroup-internal.h b/libcgroup-internal.h index af5d396..a94f6cd 100644 --- a/libcgroup-internal.h +++ b/libcgroup-internal.h @@ -26,6 +26,12 @@ __BEGIN_DECLS #define CGROUP_BUFFER_LEN (5 * FILENAME_MAX) +#ifdef CGROUP_DEBUG +#define dbg(x...) printf(x) +#else +#define dbg(x...) do {} while (0) +#endif + struct control_value { char name[FILENAME_MAX]; char value[CG_VALUE_MAX]; diff --git a/libcgroup.h b/libcgroup.h index dee4648..08613cf 100644 --- a/libcgroup.h +++ b/libcgroup.h @@ -43,12 +43,6 @@ __BEGIN_DECLS /* Estimated number of groups created */ #define MAX_GROUP_ELEMENTS 128 -#ifdef CGROUP_DEBUG -#define dbg(x...) printf(x) -#else -#define dbg(x...) do {} while(0) -#endif - /* * NOTE: Wide characters are not supported at the moment. Wide character support * would require us to use a scanner/parser that can parse beyond ASCII diff --git a/tools-common.h b/tools-common.h index cd16804..bb5dd30 100644 --- a/tools-common.h +++ b/tools-common.h @@ -19,7 +19,12 @@ #define __TOOLS_COMMON #include <libcgroup.h> -#include "libcgroup-internal.h" + +#ifdef CGROUP_DEBUG +#define dbg(x...) printf(x) +#else +#define dbg(x...) do {} while (0) +#endif /** * Auxiliary specifier of group, used to store parsed command line options. |