From 7636a470a8ccd99cfb2d89eae9b6720be5a203c4 Mon Sep 17 00:00:00 2001 From: "michael@ozlabs.org" Date: Tue, 13 Dec 2011 12:22:57 +1100 Subject: [PATCH] error: Add an accessor for progname We'd like to get the progname for help output, so add an accessor. Signed-off-by: Michael Ellerman Reviewed-by: Stefan Hajnoczi Reviewed-by: Andreas F=E4rber Signed-off-by: Michael Ellerman Signed-off-by: Anthony Liguori --- qemu-error.c | 5 +++++ qemu-error.h | 1 + 2 files changed, 6 insertions(+) diff --git a/qemu-error.c b/qemu-error.c index 4b20d283a2..7cd5ffe1e9 100644 --- a/qemu-error.c +++ b/qemu-error.c @@ -157,6 +157,11 @@ void error_set_progname(const char *argv0) progname = p ? p + 1 : argv0; } +const char *error_get_progname(void) +{ + return progname; +} + /* * Print current location to current monitor if we have one, else to stderr. */ diff --git a/qemu-error.h b/qemu-error.h index 4d5c53700e..93d74b4a30 100644 --- a/qemu-error.h +++ b/qemu-error.h @@ -36,5 +36,6 @@ void error_printf_unless_qmp(const char *fmt, ...) GCC_FMT_ATTR(1, 2); void error_print_loc(void); void error_set_progname(const char *argv0); void error_report(const char *fmt, ...) GCC_FMT_ATTR(1, 2); +const char *error_get_progname(void); #endif