diff options
author | Nalin Dahyabhai <nalin.dahyabhai@pobox.com> | 2008-07-31 14:14:24 -0400 |
---|---|---|
committer | Nalin Dahyabhai <nalin.dahyabhai@pobox.com> | 2008-07-31 14:14:24 -0400 |
commit | 1947581ec4e19fc29cb5e93cf897371edc2f5cf9 (patch) | |
tree | 26cc9ba1ebbb57a96aa6042f539bd0f68b014697 /src/back-sch.c | |
parent | 413c2ebfdeeebdc1c01aec857b13974bd885474c (diff) | |
download | slapi-nis-1947581ec4e19fc29cb5e93cf897371edc2f5cf9.tar.gz slapi-nis-1947581ec4e19fc29cb5e93cf897371edc2f5cf9.tar.xz slapi-nis-1947581ec4e19fc29cb5e93cf897371edc2f5cf9.zip |
- make some used-only-locally functions static
- warn if a map is going to be empty, because it usually signals a
misconfiguration of some kind
Diffstat (limited to 'src/back-sch.c')
-rw-r--r-- | src/back-sch.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/back-sch.c b/src/back-sch.c index b62231e..49e1dd5 100644 --- a/src/back-sch.c +++ b/src/back-sch.c @@ -1006,6 +1006,28 @@ backend_compare_cb(Slapi_PBlock *pb) return ret; } +/* Warn if a set is empty. */ +void +backend_check_empty(struct plugin_state *state, + const char *group, const char *set) +{ + unsigned int first_key_len, first_value_len; + int first_key_index; + const char *first_id; + char *first_key, *first_value; + bool_t map_secure; + if (!map_first(state, group, set, + &map_secure, + &first_key_len, &first_key, + &first_value_len, &first_value, + &first_id, + &first_key_index)) { + slapi_log_error(SLAPI_LOG_FATAL, state->plugin_desc->spd_id, + "warning: no entries set up under %s,%s\n", + set, group); + } +} + /* Populate our data cache. */ void backend_startup(struct plugin_state *state) |