#ifndef DIE_H #define DIE_H #include #include #include #include #include #include #include #include #include "built_in.h" extern void panic_handler_add(void (*on_panic)(void *arg), void *arg); extern void call_panic_handlers(void); static inline void panic(const char *format, ...) __check_format_printf(1, 2); static inline void syslog_panic(const char *format, ...) __check_format_printf(1, 2); static inline void syslog_maybe(bool cond, int priority, const char *format, ...) __check_format_printf(3, 4); static inline void __noreturn __die_hard(void) { call_panic_handlers(); exit(EXIT_FAILURE); } static inline void __noreturn __die_harder(void) { call_panic_handlers(); _exit(EXIT_FAILURE); } static inline void __noreturn die(void) { __die_hard(); } static inline void __noreturn _die(void) { __die_harder(); } static inline void __noreturn panic(const char *format, ...) { va_list vl; va_start(vl, format); vfprintf(stderr, format, vl); va_end(vl); die(); } static inline void __noreturn syslog_panic(const char *format, ...) { va_list vl; va_start(vl, format); vsyslog(LOG_ERR, format, vl); va_end(vl); die(); } static inline void syslog_maybe(bool cond, int priority, const char *format, ...) { if (cond) { va_list vl; va_start(vl, format); vsyslog(priority, format, vl); va_end(vl); } } #endif /* DIE_H */ ='sub right'>Tobias Klauser
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2015-05-11 17:48:08 +0800
committerHerbert Xu <herbert@gondor.apana.org.au>2015-05-13 10:31:44 +0800
commit9611ef63c27709f57639ab49fe3977c5947038a5 (patch)
tree42d580bf31bf6df9221220f5e58ec8484639959d /include
parent71b311d6108ecc69bf6034e03cb6bdf09335dd2c (diff)
crypto: picoxcell - Use crypto_aead_set_reqsize helper
This patch uses the crypto_aead_set_reqsize helper to avoid directly touching the internals of aead. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'include')