X-Git-Url: https://git.distorted.org.uk/~mdw/secnet/blobdiff_plain/51abbe5f68f3c784987bc5f5d9575c967ec5895d..f1393100aa5412f0df5ee363c6bdd42b2465fa59:/secnet.h diff --git a/secnet.h b/secnet.h index 2c55a32..54d84a5 100644 --- a/secnet.h +++ b/secnet.h @@ -587,6 +587,17 @@ extern NORETURN(fatal_status(int status, const char *message, ...)) extern NORETURN(fatal_perror_status(int status, const char *message, ...)) FORMAT(printf,2,3); +/* Convenient nonfatal logging. Requires message that does not end in '\n'. + * If class contains M_FATAL, exits (after entering PHASE_SHUTDOWN). + * lg, errnoval and loc may sensibly be 0. desc must NOT be 0. + * lg_[v]perror save and restore errno. */ +void lg_vperror(struct log_if *lg, const char *desc, struct cloc *loc, + int class, int errnoval, const char *fmt, va_list al) + FORMAT(printf,6,0); +void lg_perror(struct log_if *lg, const char *desc, struct cloc *loc, + int class, int errnoval, const char *fmt, ...) + FORMAT(printf,6,7); + /* The cfgfatal() family of functions require messages that end in '\n' */ extern NORETURN(cfgfatal(struct cloc loc, cstring_t facility, const char *message, ...)) FORMAT(printf,3,4);