diff options
author | Ian Jackson <Ian.Jackson@eu.citrix.com> | 2010-09-08 16:35:40 +0100 |
---|---|---|
committer | Ian Jackson <Ian.Jackson@eu.citrix.com> | 2010-09-08 16:35:40 +0100 |
commit | 0953a577a26adc935177c21115296a3637b3e0e4 (patch) | |
tree | 74e80ab93a119e615d5cfda0d3e8179bf8c3fb30 /tools | |
parent | 77a0acea701ed303efd11ef43c64345a7e32ce77 (diff) | |
download | xen-0953a577a26adc935177c21115296a3637b3e0e4.tar.gz xen-0953a577a26adc935177c21115296a3637b3e0e4.tar.bz2 xen-0953a577a26adc935177c21115296a3637b3e0e4.zip |
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 <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/libxl/xl_cmdimpl.c | 7 |
1 files changed, 5 insertions, 2 deletions
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 @@ -237,6 +237,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; char *s; @@ -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); } |