From 59938e0ed0c8ac267c3715a25a0a3ed27f7a7e47 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sun, 12 Jun 2011 20:03:33 +0100 Subject: [PATCH] logging: provide vslilog as well as slilog In general it is a mistake to provide a varargs function which takes a format string, but not the corresponding function taking a va_list. We implement slilog in terms of vslilog in the obvious way. Signed-off-by: Ian Jackson --- secnet.h | 4 +++- util.c | 7 ++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/secnet.h b/secnet.h index ede3ffc..2b913d9 100644 --- a/secnet.h +++ b/secnet.h @@ -324,9 +324,11 @@ struct log_if { log_msg_fn *log; log_vmsg_fn *vlog; }; -/* (convenience function, defined in util.c) */ +/* (convenience functions, defined in util.c) */ extern void slilog(struct log_if *lf, int class, const char *message, ...) FORMAT(printf,3,4); +extern void vslilog(struct log_if *lf, int class, const char *message, va_list) +FORMAT(printf,3,0); /* SITE interface */ diff --git a/util.c b/util.c index 9a009dc..997979a 100644 --- a/util.c +++ b/util.c @@ -198,12 +198,17 @@ bool_t remove_hook(uint32_t phase, hook_fn *fn, void *state) return False; } +void vslilog(struct log_if *lf, int priority, const char *message, va_list ap) +{ + lf->vlog(lf->st,priority,message,ap); +} + void slilog(struct log_if *lf, int priority, const char *message, ...) { va_list ap; va_start(ap,message); - lf->vlog(lf->st,priority,message,ap); + vslilog(lf,priority,message,ap); va_end(ap); } -- 2.30.2