Change view add failure result test from == ISC_R_EXISTS -> != ISC_R_SUCCESS.
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: confparser.y.dirty,v 1.33 2000/12/01 09:03:41 marka Exp $ */
+/* $Id: confparser.y.dirty,v 1.34 2000/12/01 23:27:40 marka Exp $ */
#include <config.h>
}
tmpres = dns_c_viewtable_addview(currcfg->views, view);
- if (tmpres == ISC_R_EXISTS) {
+ if (tmpres != ISC_R_SUCCESS) {
dns_c_view_delete(&view);
parser_error(ISC_FALSE,
"view '%s' already exists", $2);
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: confview.c,v 1.61 2000/12/01 19:50:52 gson Exp $ */
+/* $Id: confview.c,v 1.62 2000/12/01 23:27:42 marka Exp $ */
#include <config.h>
}
-isc_result_t
+void
dns_c_viewtable_delete(dns_c_viewtable_t **viewtable) {
dns_c_viewtable_t *table;
table->magic = 0;
isc_mem_put(table->mem, table, sizeof *table);
-
- return (ISC_R_SUCCESS);
}
elem = ISC_LIST_HEAD(viewtable->views);
while (elem != NULL) {
- if (strcmp(view->name, elem->name) == 0) {
+ if (strcmp(view->name, elem->name) == 0 &&
+ view->viewclass == elem->viewclass) {
return (ISC_R_EXISTS);
}
-isc_result_t
+void
dns_c_viewtable_clear(dns_c_viewtable_t *table) {
dns_c_view_t *elem;
dns_c_view_t *tmpelem;
dns_c_view_delete(&elem);
elem = tmpelem;
}
-
- return (ISC_R_SUCCESS);
}
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: confview.h,v 1.45 2000/12/01 09:03:44 marka Exp $ */
+/* $Id: confview.h,v 1.46 2000/12/01 23:27:43 marka Exp $ */
#ifndef DNS_CONFVIEW_H
#define DNS_CONFVIEW_H 1
isc_result_t dns_c_viewtable_new(isc_mem_t *mem,
dns_c_viewtable_t **viewtable);
-isc_result_t dns_c_viewtable_delete(dns_c_viewtable_t **viewtable);
+void dns_c_viewtable_delete(dns_c_viewtable_t **viewtable);
void dns_c_viewtable_print(FILE *fp, int indent, dns_c_viewtable_t *table);
isc_result_t dns_c_viewtable_addview(dns_c_viewtable_t *viewtable,
dns_c_view_t *view);
void dns_c_viewtable_rmview(dns_c_viewtable_t *viewtable, dns_c_view_t *view);
-isc_result_t dns_c_viewtable_clear(dns_c_viewtable_t *table);
+void dns_c_viewtable_clear(dns_c_viewtable_t *table);
isc_result_t dns_c_viewtable_viewbyname(dns_c_viewtable_t *viewtable,
const char *viewname,
dns_c_view_t **retval);