From 64d457d7ac22d643afb5638bacb0b9713274689e Mon Sep 17 00:00:00 2001 From: Donald Lee Date: Thu, 8 Jul 2021 17:51:14 +0800 Subject: [PATCH] lib: Rename frrscript_unload to delete frrscript_load now loads a function instead of a file, so frrscript_unload should be renamed since it does not unload a function. Signed-off-by: Donald Lee --- bgpd/bgp_routemap.c | 2 +- lib/command.c | 2 +- lib/frrscript.c | 2 +- lib/frrscript.h | 2 +- tests/lib/test_frrscript.c | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/bgpd/bgp_routemap.c b/bgpd/bgp_routemap.c index 0b22caaee7..c2062a5f60 100644 --- a/bgpd/bgp_routemap.c +++ b/bgpd/bgp_routemap.c @@ -434,7 +434,7 @@ route_match_script(void *rule, const struct prefix *prefix, void *object) break; } - frrscript_unload(fs); + frrscript_delete(fs); return status; } diff --git a/lib/command.c b/lib/command.c index 7808f57594..ceea186a9d 100644 --- a/lib/command.c +++ b/lib/command.c @@ -2443,7 +2443,7 @@ DEFUN(script, vty_out(vty, "p: %s\n", buf); vty_out(vty, "Script result: %d\n", ret); - frrscript_unload(fs); + frrscript_delete(fs); return CMD_SUCCESS; } diff --git a/lib/frrscript.c b/lib/frrscript.c index 8252455fd9..b3f8a9f6f5 100644 --- a/lib/frrscript.c +++ b/lib/frrscript.c @@ -319,7 +319,7 @@ fail: return 1; } -void frrscript_unload(struct frrscript *fs) +void frrscript_delete(struct frrscript *fs) { hash_iterate(fs->lua_function_hash, lua_function_free, NULL); XFREE(MTYPE_SCRIPT, fs->name); diff --git a/lib/frrscript.h b/lib/frrscript.h index 1f234a38a9..14a922a741 100644 --- a/lib/frrscript.h +++ b/lib/frrscript.h @@ -89,7 +89,7 @@ int frrscript_load(struct frrscript *fs, const char *function_name, /* * Destroy FRR script. */ -void frrscript_unload(struct frrscript *fs); +void frrscript_delete(struct frrscript *fs); /* * Register a Lua codec for a type. diff --git a/tests/lib/test_frrscript.c b/tests/lib/test_frrscript.c index e01807f193..2d5746b587 100644 --- a/tests/lib/test_frrscript.c +++ b/tests/lib/test_frrscript.c @@ -98,7 +98,7 @@ int main(int argc, char **argv) result = frrscript_call(fs, "bad_return4"); assert(result == 1); - frrscript_unload(fs); + frrscript_delete(fs); return 0; } -- 2.39.5