diff options
author | Eric Faurot <eric@cvs.openbsd.org> | 2013-11-18 11:47:17 +0000 |
---|---|---|
committer | Eric Faurot <eric@cvs.openbsd.org> | 2013-11-18 11:47:17 +0000 |
commit | 75603064b42dfb9d84166feb14807431559f25a3 (patch) | |
tree | e648f6663481337b3cb02211cdf4780dc43cae7b /usr.sbin | |
parent | ce2fb986d5ad44761ff5d96b8e2770b7e5cd8b6a (diff) |
change dict_poproot() prototype: do not take key placeholder parameter as
it can't work that way.
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/smtpd/config.c | 4 | ||||
-rw-r--r-- | usr.sbin/smtpd/dict.c | 6 | ||||
-rw-r--r-- | usr.sbin/smtpd/envelope.c | 4 | ||||
-rw-r--r-- | usr.sbin/smtpd/smtpd-api.h | 8 | ||||
-rw-r--r-- | usr.sbin/smtpd/table.c | 4 | ||||
-rw-r--r-- | usr.sbin/smtpd/table_passwd.c | 6 | ||||
-rw-r--r-- | usr.sbin/smtpd/table_sqlite.c | 4 | ||||
-rw-r--r-- | usr.sbin/smtpd/table_static.c | 4 |
8 files changed, 19 insertions, 21 deletions
diff --git a/usr.sbin/smtpd/config.c b/usr.sbin/smtpd/config.c index c647a479b69..f22da008ad9 100644 --- a/usr.sbin/smtpd/config.c +++ b/usr.sbin/smtpd/config.c @@ -1,4 +1,4 @@ -/* $OpenBSD: config.c,v 1.20 2013/05/24 17:03:14 eric Exp $ */ +/* $OpenBSD: config.c,v 1.21 2013/11/18 11:47:16 eric Exp $ */ /* * Copyright (c) 2008 Pierre-Yves Ritschard <pyr@openbsd.org> @@ -67,7 +67,7 @@ purge_config(uint8_t what) env->sc_rules = NULL; } if (what & PURGE_SSL) { - while (dict_poproot(env->sc_ssl_dict, NULL, (void **)&s)) { + while (dict_poproot(env->sc_ssl_dict, (void **)&s)) { bzero(s->ssl_cert, s->ssl_cert_len); bzero(s->ssl_key, s->ssl_key_len); free(s->ssl_cert); diff --git a/usr.sbin/smtpd/dict.c b/usr.sbin/smtpd/dict.c index 3a1a63e56f0..65666d73e84 100644 --- a/usr.sbin/smtpd/dict.c +++ b/usr.sbin/smtpd/dict.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dict.c,v 1.3 2013/10/25 20:08:31 eric Exp $ */ +/* $OpenBSD: dict.c,v 1.4 2013/11/18 11:47:16 eric Exp $ */ /* * Copyright (c) 2012 Gilles Chehade <gilles@poolp.org> @@ -162,15 +162,13 @@ dict_xpop(struct dict *d, const char *k) } int -dict_poproot(struct dict *d, const char **k, void **data) +dict_poproot(struct dict *d, void **data) { struct dictentry *entry; entry = SPLAY_ROOT(&d->dict); if (entry == NULL) return (0); - if (k) - *k = entry->key; if (data) *data = entry->data; SPLAY_REMOVE(_dict, &d->dict, entry); diff --git a/usr.sbin/smtpd/envelope.c b/usr.sbin/smtpd/envelope.c index aa884d97afc..9f8489f22ea 100644 --- a/usr.sbin/smtpd/envelope.c +++ b/usr.sbin/smtpd/envelope.c @@ -1,4 +1,4 @@ -/* $OpenBSD: envelope.c,v 1.22 2013/11/06 10:01:29 eric Exp $ */ +/* $OpenBSD: envelope.c,v 1.23 2013/11/18 11:47:16 eric Exp $ */ /* * Copyright (c) 2013 Eric Faurot <eric@openbsd.org> @@ -161,7 +161,7 @@ envelope_load_buffer(struct envelope *ep, const char *ibuf, size_t buflen) if (ret) ep->version = SMTPD_ENVELOPE_VERSION; end: - while (dict_poproot(&d, NULL, NULL)) + while (dict_poproot(&d, NULL)) ; return (ret); } diff --git a/usr.sbin/smtpd/smtpd-api.h b/usr.sbin/smtpd/smtpd-api.h index 46eeaa01868..0c3224f59a6 100644 --- a/usr.sbin/smtpd/smtpd-api.h +++ b/usr.sbin/smtpd/smtpd-api.h @@ -1,4 +1,4 @@ -/* $OpenBSD: smtpd-api.h,v 1.10 2013/10/27 17:47:53 eric Exp $ */ +/* $OpenBSD: smtpd-api.h,v 1.11 2013/11/18 11:47:16 eric Exp $ */ /* * Copyright (c) 2013 Eric Faurot <eric@openbsd.org> @@ -231,9 +231,9 @@ void *dict_get(struct dict *, const char *); void *dict_xget(struct dict *, const char *); void *dict_pop(struct dict *, const char *); void *dict_xpop(struct dict *, const char *); -int dict_poproot(struct dict *, const char * *, void **); -int dict_root(struct dict *, const char * *, void **); -int dict_iter(struct dict *, void **, const char * *, void **); +int dict_poproot(struct dict *, void **); +int dict_root(struct dict *, const char **, void **); +int dict_iter(struct dict *, void **, const char **, void **); int dict_iterfrom(struct dict *, void **, const char *, const char **, void **); void dict_merge(struct dict *, struct dict *); diff --git a/usr.sbin/smtpd/table.c b/usr.sbin/smtpd/table.c index eab159441a4..f1e6a94d472 100644 --- a/usr.sbin/smtpd/table.c +++ b/usr.sbin/smtpd/table.c @@ -1,4 +1,4 @@ -/* $OpenBSD: table.c,v 1.10 2013/10/28 18:49:14 eric Exp $ */ +/* $OpenBSD: table.c,v 1.11 2013/11/18 11:47:16 eric Exp $ */ /* * Copyright (c) 2013 Eric Faurot <eric@openbsd.org> @@ -263,7 +263,7 @@ table_destroy(struct table *t) { void *p = NULL; - while (dict_poproot(&t->t_dict, NULL, (void **)&p)) + while (dict_poproot(&t->t_dict, (void **)&p)) free(p); dict_xpop(env->sc_tables_dict, t->t_name); diff --git a/usr.sbin/smtpd/table_passwd.c b/usr.sbin/smtpd/table_passwd.c index baca7792470..14193561362 100644 --- a/usr.sbin/smtpd/table_passwd.c +++ b/usr.sbin/smtpd/table_passwd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: table_passwd.c,v 1.4 2013/10/26 12:27:59 eric Exp $ */ +/* $OpenBSD: table_passwd.c,v 1.5 2013/11/18 11:47:16 eric Exp $ */ /* * Copyright (c) 2013 Gilles Chehade <gilles@poolp.org> @@ -122,7 +122,7 @@ table_passwd_update(void) /* swap passwd table and release old one*/ if (passwd) - while (dict_poproot(passwd, NULL, (void**)&buf)) + while (dict_poproot(passwd, (void**)&buf)) free(buf); passwd = npasswd; @@ -135,7 +135,7 @@ err: /* release passwd table */ if (npasswd) { - while (dict_poproot(npasswd, NULL, (void**)&buf)) + while (dict_poproot(npasswd, (void**)&buf)) free(buf); free(npasswd); } diff --git a/usr.sbin/smtpd/table_sqlite.c b/usr.sbin/smtpd/table_sqlite.c index f2e91f08df8..847c409c2ad 100644 --- a/usr.sbin/smtpd/table_sqlite.c +++ b/usr.sbin/smtpd/table_sqlite.c @@ -1,4 +1,4 @@ -/* $OpenBSD: table_sqlite.c,v 1.8 2013/10/26 12:27:59 eric Exp $ */ +/* $OpenBSD: table_sqlite.c,v 1.9 2013/11/18 11:47:16 eric Exp $ */ /* * Copyright (c) 2013 Eric Faurot <eric@openbsd.org> @@ -494,7 +494,7 @@ table_sqlite_fetch(int service, char *dst, size_t sz) goto fetch; source_iter = NULL; - while(dict_poproot(&sources, NULL, NULL)) + while (dict_poproot(&sources, NULL)) ; while ((s = sqlite3_step(stmt_fetch_source)) == SQLITE_ROW) diff --git a/usr.sbin/smtpd/table_static.c b/usr.sbin/smtpd/table_static.c index 7450bece52d..74328fcce8c 100644 --- a/usr.sbin/smtpd/table_static.c +++ b/usr.sbin/smtpd/table_static.c @@ -1,4 +1,4 @@ -/* $OpenBSD: table_static.c,v 1.6 2013/10/28 18:50:23 eric Exp $ */ +/* $OpenBSD: table_static.c,v 1.7 2013/11/18 11:47:16 eric Exp $ */ /* * Copyright (c) 2013 Eric Faurot <eric@openbsd.org> @@ -161,7 +161,7 @@ table_static_update(struct table *table) goto err; /* replace former table, frees t */ - while (dict_poproot(&table->t_dict, NULL, (void **)&p)) + while (dict_poproot(&table->t_dict, (void **)&p)) free(p); dict_merge(&table->t_dict, &t->t_dict); table_destroy(t); |