Eric Blake <ebl...@redhat.com> writes: > On 06/22/2015 01:26 PM, Markus Armbruster wrote: >> Duplicated when commit 680d16d added error_set_errno(), and again when >> commit 20840d4 added error_set_win32(). >> >> Make the original copy in error_set() reusable by factoring out >> error_setv(), then rewrite error_set_errno() and error_set_win32() on >> top of it. >> >> Signed-off-by: Markus Armbruster <arm...@redhat.com> >> --- >> util/error.c | 69 >> ++++++++++++++++++++++-------------------------------------- >> 1 file changed, 25 insertions(+), 44 deletions(-) > >> @@ -96,37 +90,24 @@ void error_setg_file_open(Error **errp, int os_errno, >> const char *filename) >> void error_set_win32(Error **errp, int win32_err, ErrorClass err_class, >> const char *fmt, ...) >> { > >> if (win32_err != 0) { >> - char *msg2 = g_win32_error_message(win32_err); >> - err->msg = g_strdup_printf("%s: %s (error: %x)", msg1, msg2, >> - (unsigned)win32_err); >> + msg1 = (*errp)->msg; >> + msg2 = g_win32_error_message(win32_err); >> + (*errp)->msg = g_strdup_printf("%s: %s", msg1, msg2); > > Loses " (error: %x)". Do we care? I don't, except maybe in the commit > message...
Unintentional, I'll put it right back. (I don't care either, but dropping it deserves its own commit) > Reviewed-by: Eric Blake <ebl...@redhat.com> Thanks!