From 0953a577a26adc935177c21115296a3637b3e0e4 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Wed, 8 Sep 2010 16:35:40 +0100 Subject: xl: correct calls to dolog() (aka LOG) dolog, for which LOG is a macro wrapper, was lacking the printf format attribute. Add it, and fix the two problems revealed. (Original patch for one of the occurrences from Ian Campbell.) Signed-off-by: Ian Campbell Signed-off-by: Ian Jackson --- tools/libxl/xl_cmdimpl.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'tools') diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c index c2bfa0d311..c042426228 100644 --- a/tools/libxl/xl_cmdimpl.c +++ b/tools/libxl/xl_cmdimpl.c @@ -236,6 +236,9 @@ static void find_domain(const char *p) #define LOG(_f, _a...) dolog(__FILE__, __LINE__, __func__, _f "\n", ##_a) +static void dolog(const char *file, int line, const char *func, char *fmt, ...) + __attribute__((format(printf,4,5))); + static void dolog(const char *file, int line, const char *func, char *fmt, ...) { va_list ap; @@ -1123,7 +1126,7 @@ static int handle_domain_death(libxl_ctx *ctx, uint32_t domid, libxl_event *even action = d_config->on_watchdog; break; default: - LOG("Unknown shutdown reason code %s. Destroying domain.", info->shutdown_reason); + LOG("Unknown shutdown reason code %d. Destroying domain.", info->shutdown_reason); action = ACTION_DESTROY; } @@ -1537,7 +1540,7 @@ start: } rc = libxl_create_logfile(&ctx, name, &fullname); if (rc) { - LOG("failed to open logfile %s",fullname,strerror(errno)); + LOG("failed to open logfile %s: %s",fullname,strerror(errno)); exit(-1); } -- cgit v1.2.3