Use check_debug_level() instead of writing out the exact same check in
msg_test().
Signed-off-by: Steffan Karger <steffan@karger.me>
Acked-by: David Sommerseth <davids@openvpn.net>
Message-Id: 1472757207-17900-1-git-send-email-steffan@karger.me
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg00192.html
Signed-off-by: David Sommerseth <davids@openvpn.net>
... | ... |
@@ -138,12 +138,6 @@ extern int x_msg_line_num; |
138 | 138 |
/** Check muting filter */ |
139 | 139 |
bool dont_mute (unsigned int flags); |
140 | 140 |
|
141 |
-/** Return true if flags represent an enabled, not muted log level */ |
|
142 |
-static inline bool msg_test (unsigned int flags) |
|
143 |
-{ |
|
144 |
- return ((flags & M_DEBUG_LEVEL) <= x_debug_level) && dont_mute (flags); |
|
145 |
-} |
|
146 |
- |
|
147 | 141 |
/* Macro to ensure (and teach static analysis tools) we exit on fatal errors */ |
148 | 142 |
#define EXIT_FATAL(flags) do { if ((flags) & M_FATAL) _exit(1); } while (false) |
149 | 143 |
|
... | ... |
@@ -237,6 +231,12 @@ check_debug_level (unsigned int level) |
237 | 237 |
return (level & M_DEBUG_LEVEL) <= x_debug_level; |
238 | 238 |
} |
239 | 239 |
|
240 |
+/** Return true if flags represent an enabled, not muted log level */ |
|
241 |
+static inline bool msg_test (unsigned int flags) |
|
242 |
+{ |
|
243 |
+ return check_debug_level (flags) && dont_mute (flags); |
|
244 |
+} |
|
245 |
+ |
|
240 | 246 |
/* Call if we forked */ |
241 | 247 |
void msg_forked (void); |
242 | 248 |
|