From 31bc44c5a9b9fa30c65c328f60a93bcac7e060e2 Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Thu, 19 Jan 2017 14:24:26 +0200 Subject: [PATCH] Actually return errors from macro definition --- rpmio/macro.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/rpmio/macro.c b/rpmio/macro.c index 60a656168..07b39c19f 100644 --- a/rpmio/macro.c +++ b/rpmio/macro.c @@ -1418,12 +1418,14 @@ static void popMacro(rpmMacroContext mc, const char * n) static int defineMacro(rpmMacroContext mc, const char * macro, int level) { MacroBuf mb = xcalloc(1, sizeof(*mb)); + int rc; /* XXX just enough to get by */ mb->mc = mc; (void) doDefine(mb, macro, strlen(macro), level, 0); + rc = mb->error; _free(mb); - return 0; + return rc; } static int loadMacroFile(rpmMacroContext mc, const char * fn) @@ -1529,10 +1531,11 @@ void rpmPopMacro(rpmMacroContext mc, const char * n) int rpmDefineMacro(rpmMacroContext mc, const char * macro, int level) { + int rc; mc = rpmmctxAcquire(mc); - (void) defineMacro(mc, macro, level); + rc = defineMacro(mc, macro, level); rpmmctxRelease(mc); - return 0; + return rc; } void