diff options
author | Jakub Hrozek <jhrozek@redhat.com> | 2013-05-12 12:29:21 +0200 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2013-06-07 00:14:12 +0200 |
commit | 7119f0c483049a8850d3075c0b1062f35200a538 (patch) | |
tree | 7be03fca0634dda1406df2b9bde387ca7c89877e /src/providers/ipa | |
parent | 7527ec8ab2b79ec576ace2da9e2c158b849adfa6 (diff) | |
download | sssd-7119f0c483049a8850d3075c0b1062f35200a538.tar.gz sssd-7119f0c483049a8850d3075c0b1062f35200a538.tar.bz2 sssd-7119f0c483049a8850d3075c0b1062f35200a538.zip |
Do not obfuscate calls with booleans
Instead of using boolean variables to denote whether the call is adding
a primary or a secondary server, use a function wrapper that tells what
it's doing by its name.
Diffstat (limited to 'src/providers/ipa')
-rw-r--r-- | src/providers/ipa/ipa_common.c | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/src/providers/ipa/ipa_common.c b/src/providers/ipa/ipa_common.c index 509b2abd..ec36b57d 100644 --- a/src/providers/ipa/ipa_common.c +++ b/src/providers/ipa/ipa_common.c @@ -754,11 +754,11 @@ static void ipa_resolve_callback(void *private_data, struct fo_server *server) talloc_free(tmp_ctx); } -errno_t ipa_servers_init(struct be_ctx *ctx, - struct ipa_service *service, - struct ipa_options *options, - const char *servers, - bool primary) +static errno_t _ipa_servers_init(struct be_ctx *ctx, + struct ipa_service *service, + struct ipa_options *options, + const char *servers, + bool primary) { TALLOC_CTX *tmp_ctx; char **list = NULL; @@ -825,6 +825,20 @@ done: return ret; } +static inline errno_t +ipa_primary_servers_init(struct be_ctx *ctx, struct ipa_service *service, + struct ipa_options *options, const char *servers) +{ + return _ipa_servers_init(ctx, service, options, servers, true); +} + +static inline errno_t +ipa_backup_servers_init(struct be_ctx *ctx, struct ipa_service *service, + struct ipa_options *options, const char *servers) +{ + return _ipa_servers_init(ctx, service, options, servers, false); +} + static int ipa_user_data_cmp(void *ud1, void *ud2) { return strcasecmp((char*) ud1, (char*) ud2); @@ -900,13 +914,13 @@ int ipa_service_init(TALLOC_CTX *memctx, struct be_ctx *ctx, primary_servers = BE_SRV_IDENTIFIER; } - ret = ipa_servers_init(ctx, service, options, primary_servers, true); + ret = ipa_primary_servers_init(ctx, service, options, primary_servers); if (ret != EOK) { goto done; } if (backup_servers) { - ret = ipa_servers_init(ctx, service, options, backup_servers, false); + ret = ipa_backup_servers_init(ctx, service, options, backup_servers); if (ret != EOK) { goto done; } |