Skip to content
Snippets Groups Projects
Commit 688b03f9 authored by Simon McVittie's avatar Simon McVittie
Browse files

utils: Add capsule_err(), capsule_warn() wrappers for capsule_log()


These mimic the behaviour of errx() and warnx(), but will benefit from
future enhancements to capsule_log().

Signed-off-by: default avatarSimon McVittie <smcv@collabora.com>
parent 637eeca2
Branches
Tags
No related merge requests found
......@@ -50,3 +50,12 @@ void set_debug_flags (const char *control);
void capsule_log (int log_level, const char *fmt, ...) __attribute__((__format__(__printf__, 2, 3)));
void capsule_logv (int log_level, const char *fmt, va_list ap) __attribute__((__format__(__printf__, 2, 0)));
#define capsule_err(status, fmt, args...) \
do { \
capsule_log( LOG_ERR, fmt, ##args ); \
exit (status); \
} while (0)
#define capsule_warn(fmt, args...) \
capsule_log( LOG_WARNING, fmt, ##args )
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment