diff options
| author | Florian Weimer <fweimer@redhat.com> | 2025-11-17 18:43:50 +0100 |
|---|---|---|
| committer | Florian Weimer <fweimer@redhat.com> | 2025-11-18 09:51:02 +0100 |
| commit | 5029b63280b505467d3452e91a1c51705e34ed35 (patch) | |
| tree | 10438dff074e26a295190de424fc3a54b5646fe3 | |
| parent | a025a9deef8ad0034e88785a6999014fa2808e12 (diff) | |
nss: Remove effectively unused struct nss_database_default_cache
We always start with a zero-initialized cache, so this is completely
ineffective.
Reviewed-by: Collin Funk <collin.funk1@gmail.com>
| -rw-r--r-- | nss/nss_database.c | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/nss/nss_database.c b/nss/nss_database.c index a7ac32beb9..bed353c59b 100644 --- a/nss/nss_database.c +++ b/nss/nss_database.c @@ -105,19 +105,10 @@ static const char per_database_defaults[NSS_DATABASE_COUNT] = [nss_database_shadow_compat] = nss_database_default_nis, }; -struct nss_database_default_cache -{ - nss_action_list caches[NSS_DATABASE_DEFAULT_COUNT]; -}; - static bool -nss_database_select_default (struct nss_database_default_cache *cache, - enum nss_database db, nss_action_list *result) +nss_database_select_default (enum nss_database db, nss_action_list *result) { enum nss_database_default def = per_database_defaults[db]; - *result = cache->caches[def]; - if (*result != NULL) - return true; /* Determine the default line string. */ const char *line; @@ -337,8 +328,6 @@ nss_database_reload (struct nss_database_data *staging, /* Apply defaults. */ if (ok) { - struct nss_database_default_cache cache = { }; - /* These three default to other services if the user listed the other service. */ @@ -365,8 +354,7 @@ nss_database_reload (struct nss_database_data *staging, for (int i = 0; i < NSS_DATABASE_COUNT; ++i) if (staging->services[i] == NULL) { - ok = nss_database_select_default (&cache, i, - &staging->services[i]); + ok = nss_database_select_default (i, &staging->services[i]); if (!ok) break; } |
