From e5b4b49e804b0e89ad2dfad2c13b36274538e08a Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Tue, 27 Aug 2019 07:45:02 -0400 Subject: lib: Cleanup return codes to use enum values A couple functions in routemap.c were returning 0/1 that were being mapped into the appropriate enum values on the calling functions to check return values. This matches the return values to the actual enum for future readability. Signed-off-by: Donald Sharp --- lib/routemap.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'lib/routemap.c') diff --git a/lib/routemap.c b/lib/routemap.c index eca02e836..c57415303 100644 --- a/lib/routemap.c +++ b/lib/routemap.c @@ -1472,7 +1472,7 @@ int route_map_delete_match(struct route_map_index *index, cmd = route_map_lookup_match(match_name); if (cmd == NULL) - return 1; + return RMAP_RULE_MISSING; for (rule = index->match_list.head; rule; rule = rule->next) if (rule->cmd == cmd && (rulecmp(rule->rule_str, match_arg) == 0 @@ -1485,10 +1485,10 @@ int route_map_delete_match(struct route_map_index *index, index->map->name, RMAP_EVENT_CALL_ADDED); } - return 0; + return RMAP_COMPILE_SUCCESS; } /* Can't find matched rule. */ - return 1; + return RMAP_RULE_MISSING; } /* Add route-map set statement to the route map. */ @@ -1551,7 +1551,7 @@ int route_map_delete_set(struct route_map_index *index, const char *set_name, cmd = route_map_lookup_set(set_name); if (cmd == NULL) - return 1; + return RMAP_RULE_MISSING; for (rule = index->set_list.head; rule; rule = rule->next) if ((rule->cmd == cmd) && (rulecmp(rule->rule_str, set_arg) == 0 @@ -1564,10 +1564,10 @@ int route_map_delete_set(struct route_map_index *index, const char *set_name, index->map->name, RMAP_EVENT_CALL_ADDED); } - return 0; + return RMAP_COMPILE_SUCCESS; } /* Can't find matched rule. */ - return 1; + return RMAP_RULE_MISSING; } static enum route_map_cmd_result_t -- cgit v1.2.3