From 05366596a6bd613ccbe22dd2376df3cab169e030 Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Fri, 17 May 2019 09:38:29 +0300 Subject: [PATCH] Consider macro file load fail on any errors The previous "only fail if everything fails" behavior from commit f7aff1193e7a27b631030f332ecfe87046853903 is just too arbitrary to live. If there was a failure, it failed. Period. --- rpmio/macro.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/rpmio/macro.c b/rpmio/macro.c index fb76e5235..aafde8f14 100644 --- a/rpmio/macro.c +++ b/rpmio/macro.c @@ -1599,7 +1599,6 @@ static int loadMacroFile(rpmMacroContext mc, const char * fn) size_t blen = MACROBUFSIZ; char *buf = xmalloc(blen); int rc = -1; - int ndefs = 0; int nfailed = 0; if (fd == NULL) @@ -1615,14 +1614,12 @@ static int loadMacroFile(rpmMacroContext mc, const char * fn) if (c != '%') continue; n++; /* skip % */ - ndefs++; if (defineMacro(mc, n, RMIL_MACROFILES)) nfailed++; } fclose(fd); - /* if all definitions fail then return an error, otherwise just warn */ - rc = (nfailed && ndefs == nfailed); + rc = (nfailed > 0); if (nfailed) { rpmlog(rc ? RPMLOG_ERR : RPMLOG_WARNING,