X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?a=blobdiff_plain;f=secnet.h;h=9ddd69db6ab799511b2a1dcc3759038febbe1a34;hb=af3aca5d1f73bf8f47d15c23b0969a3df8e8dba2;hp=0537e39cdc4a3b8c807be43e48fbae127bc18955;hpb=e2e19438e0d4d68d8166e19f0f5086941271988d;p=secnet.git diff --git a/secnet.h b/secnet.h index 0537e39..9ddd69d 100644 --- a/secnet.h +++ b/secnet.h @@ -579,6 +579,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);