[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [xen master] tools/libs/ctrl: Save errno only once in *PRINTF() and *ERROR()
commit f10202d5c7c296c52a69775a4faab7db1b2e478d Author: Juergen Gross <jgross@xxxxxxxx> AuthorDate: Thu Dec 9 14:40:54 2021 +0100 Commit: Andrew Cooper <andrew.cooper3@xxxxxxxxxx> CommitDate: Thu Dec 9 16:26:29 2021 +0000 tools/libs/ctrl: Save errno only once in *PRINTF() and *ERROR() All *PRINTF() and *ERROR() macros are based on xc_reportv() which is saving and restoring errno in order to not modify it. There is no need to save and restore in those macros, too. Signed-off-by: Juergen Gross <jgross@xxxxxxxx> Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx> --- tools/libs/ctrl/xc_private.h | 34 ++++++++++++---------------------- 1 file changed, 12 insertions(+), 22 deletions(-) diff --git a/tools/libs/ctrl/xc_private.h b/tools/libs/ctrl/xc_private.h index 2e483590e6..6fc98a35a8 100644 --- a/tools/libs/ctrl/xc_private.h +++ b/tools/libs/ctrl/xc_private.h @@ -122,28 +122,18 @@ void xc_report_progress_step(xc_interface *xch, /* anamorphic macros: struct xc_interface *xch must be in scope */ -#define IPRINTF(_f, _a...) do { int IPRINTF_errno = errno; \ - xc_report(xch, xch->error_handler, XTL_INFO,0, _f , ## _a); \ - errno = IPRINTF_errno; \ - } while (0) -#define DPRINTF(_f, _a...) do { int DPRINTF_errno = errno; \ - xc_report(xch, xch->error_handler, XTL_DETAIL,0, _f , ## _a); \ - errno = DPRINTF_errno; \ - } while (0) -#define DBGPRINTF(_f, _a...) do { int DBGPRINTF_errno = errno; \ - xc_report(xch, xch->error_handler, XTL_DEBUG,0, _f , ## _a); \ - errno = DBGPRINTF_errno; \ - } while (0) - -#define ERROR(_m, _a...) do { int ERROR_errno = errno; \ - xc_report_error(xch,XC_INTERNAL_ERROR,_m , ## _a ); \ - errno = ERROR_errno; \ - } while (0) -#define PERROR(_m, _a...) do { int PERROR_errno = errno; \ - xc_report_error(xch,XC_INTERNAL_ERROR,_m " (%d = %s)", \ - ## _a , errno, xc_strerror(xch, errno)); \ - errno = PERROR_errno; \ - } while (0) +#define IPRINTF(_f, _a...) \ + xc_report(xch, xch->error_handler, XTL_INFO, 0, _f, ## _a) +#define DPRINTF(_f, _a...) \ + xc_report(xch, xch->error_handler, XTL_DETAIL, 0, _f, ## _a) +#define DBGPRINTF(_f, _a...) \ + xc_report(xch, xch->error_handler, XTL_DEBUG, 0, _f, ## _a) + +#define ERROR(_m, _a...) \ + xc_report_error(xch, XC_INTERNAL_ERROR, _m, ## _a) +#define PERROR(_m, _a...) \ + xc_report_error(xch, XC_INTERNAL_ERROR, _m " (%d = %s)", \ + ## _a, errno, xc_strerror(xch, errno)) /* * HYPERCALL ARGUMENT BUFFERS -- generated by git-patchbot for /home/xen/git/xen.git#master
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |