From 2155081e1d9888cf57334bc57abb3fff9b49d8e1 Mon Sep 17 00:00:00 2001 From: Charley Wang Date: Tue, 6 Oct 2009 10:26:36 -0400 Subject: PR10724: staprun: simplify permissions checking logic Pending advice from Frank and Dave, changed check_permission to return void and renamed it to assert_permission. assert_permission simply returns if permissions are okay, and calls exit(-1) if there are any permissions errors. --- runtime/staprun/staprun.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'runtime/staprun/staprun.c') diff --git a/runtime/staprun/staprun.c b/runtime/staprun/staprun.c index da3e304b..7b4aba1c 100644 --- a/runtime/staprun/staprun.c +++ b/runtime/staprun/staprun.c @@ -227,14 +227,14 @@ int init_staprun(void) without first removing the kernel module. This would block a subsequent rerun attempt. So here we gingerly try to unload it first. */ - int ret = delete_module (modname, O_NONBLOCK); - err("Retrying, after attempted removal of module %s (rc %d)\n", modname, ret); - /* Then we try an insert a second time. */ - if (insert_stap_module() < 0) - return -1; - } - if (send_relocations() < 0) - return -1; + int ret = delete_module (modname, O_NONBLOCK); + err("Retrying, after attempted removal of module %s (rc %d)\n", modname, ret); + /* Then we try an insert a second time. */ + if (insert_stap_module() < 0) + return -1; + } + if (send_relocations() < 0) + return -1; } return 0; } -- cgit