From dd6a4fb9ae4825caf4ccb835f8b8221c96bbb6f5 Mon Sep 17 00:00:00 2001 From: Fabiano Fidêncio Date: Aug 28 2017 18:41:45 +0000 Subject: HBAC: Improve readability of ipa_hbac_rule_info_send() Move an if condition inside another if condition in order to make the readability a little bit more clear that those checks are about the same return code. Signed-off-by: Fabiano Fidêncio Reviewed-by: Pavel Březina Reviewed-by: Jakub Hrozek --- diff --git a/src/providers/ipa/ipa_hbac_rules.c b/src/providers/ipa/ipa_hbac_rules.c index 404778d..d188971 100644 --- a/src/providers/ipa/ipa_hbac_rules.c +++ b/src/providers/ipa/ipa_hbac_rules.c @@ -165,19 +165,18 @@ ipa_hbac_rule_info_send(TALLOC_CTX *mem_ctx, state->rules_filter = talloc_steal(state, rule_filter); ret = ipa_hbac_rule_info_next(req, state); - if (ret == EOK) { - /* ipa_hbac_rule_info_next should always have a search base when called - * for the first time. - * - * For the subsequent iterations, not finding any more search bases is - * fine though (thus the function returns EOK). - * - * As, here, it's the first case happening, let's return EINVAL. - */ - ret = EINVAL; - } - if (ret != EAGAIN) { + if (ret == EOK) { + /* ipa_hbac_rule_info_next should always have a search base when + * called for the first time. + * + * For the subsequent iterations, not finding any more search bases + * is fine though (thus the function returns EOK). + * + * As, here, it's the first case happening, let's return EINVAL. + */ + ret = EINVAL; + } goto immediate; }