]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: global: add proc_mask() and thread_mask()
authorWilly Tarreau <w@1wt.eu>
Sat, 2 Feb 2019 16:22:19 +0000 (17:22 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 4 Feb 2019 04:09:15 +0000 (05:09 +0100)
These two functions return either all_{proc,threads}_mask, or the argument.
This is used to default to all_proc_mask or all_threads_mask when not set
on bind_conf or proxies.

include/types/global.h

index 879273a929827d6db086912841d0ac76b5c1e993..178b2c14dab257dc8e463908c1837be8971c34b4 100644 (file)
@@ -239,6 +239,18 @@ static inline int already_warned(unsigned int warning)
        return 0;
 }
 
+/* returns a mask if set, otherwise all_proc_mask */
+static inline unsigned long proc_mask(unsigned long mask)
+{
+       return mask ? mask : all_proc_mask;
+}
+
+/* returns a mask if set, otherwise all_threads_mask */
+static inline unsigned long thread_mask(unsigned long mask)
+{
+       return mask ? mask : all_threads_mask;
+}
+
 void deinit(void);
 void hap_register_build_opts(const char *str, int must_free);
 void hap_register_post_check(int (*fct)());