diff options
author | Charley Wang <chwang@redhat.com> | 2009-10-06 10:26:36 -0400 |
---|---|---|
committer | Frank Ch. Eigler <fche@elastic.org> | 2009-10-06 10:26:36 -0400 |
commit | 2155081e1d9888cf57334bc57abb3fff9b49d8e1 (patch) | |
tree | fdc7a44fe9ecc630c9c1c938b777c1c461919f6e /runtime/staprun/staprun.c | |
parent | e82cb6e94e5028637bdf0eedc0f6035139629a90 (diff) | |
download | systemtap-steved-2155081e1d9888cf57334bc57abb3fff9b49d8e1.tar.gz systemtap-steved-2155081e1d9888cf57334bc57abb3fff9b49d8e1.tar.xz systemtap-steved-2155081e1d9888cf57334bc57abb3fff9b49d8e1.zip |
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.
Diffstat (limited to 'runtime/staprun/staprun.c')
-rw-r--r-- | runtime/staprun/staprun.c | 16 |
1 files changed, 8 insertions, 8 deletions
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; } |