From: Willy Tarreau Date: Sat, 2 Feb 2019 16:22:19 +0000 (+0100) Subject: MINOR: global: add proc_mask() and thread_mask() X-Git-Tag: v2.0-dev1~68 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2415727a00e09bf0228777364488fc242e75139b;p=thirdparty%2Fhaproxy.git MINOR: global: add proc_mask() and thread_mask() 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. --- diff --git a/include/types/global.h b/include/types/global.h index 879273a929..178b2c14da 100644 --- a/include/types/global.h +++ b/include/types/global.h @@ -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)());