summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Gnatenko <ignatenko@redhat.com>2016-07-26 11:35:29 +0200
committerIgor Gnatenko <ignatenko@redhat.com>2016-07-26 11:38:10 +0200
commit215f3e9466650819b0f5ebdb01512629bfd4fce1 (patch)
treefb65b238b52fa6ded1c5d456e0688067f133be3a
parent6a8754b2153e0e4305ef2bc5a789bfe02f65e889 (diff)
downloadrpm-215f3e9466650819b0f5ebdb01512629bfd4fce1.tar.gz
rpmplugins: don't print error if return code is RPMRC_NOTFOUND
For example, in simple docer container there is no systemd, so systemd_inhibit plugin returns RPMRC_NOTFOUND in _init() which automatically disables plugin (!= RPMRC_OK). So let's say that if plugin returns RPMRC_NOTFOUND during init() it's just signal to disable plugin and not show error. Signed-off-by: Igor Gnatenko <ignatenko@redhat.com>
-rw-r--r--lib/rpmplugins.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/rpmplugins.c b/lib/rpmplugins.c
index f37416bb0..1022024c2 100644
--- a/lib/rpmplugins.c
+++ b/lib/rpmplugins.c
@@ -215,8 +215,9 @@ static rpmRC rpmpluginsCallInit(rpmPlugin plugin, rpmts ts)
plugin_init_func hookFunc;
RPMPLUGINS_SET_HOOK_FUNC(init);
if (hookFunc)
- if ((rc = hookFunc(plugin, ts)) != RPMRC_OK)
- rpmlog(RPMLOG_ERR, "Plugin %s: hook init failed\n", plugin->name);
+ rc = hookFunc(plugin, ts);
+ if (rc != RPMRC_OK && rc != RPMRC_NOTFOUND)
+ rpmlog(RPMLOG_ERR, "Plugin %s: hook init failed\n", plugin->name);
return rc;
}