Skip to content

Commit

Permalink
conmon: drop return after pexit()
Browse files Browse the repository at this point in the history
pexit terminates the current process, no need to return from the function.

Signed-off-by: Giuseppe Scrivano <[email protected]>
  • Loading branch information
giuseppe authored and haircommander committed Apr 28, 2023
1 parent d637b73 commit 3b447bc
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions src/seccomp_notify.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ int seccomp_notify_plugins_load(struct seccomp_notify_context_s **out, const cha

if (seccomp_syscall(SECCOMP_GET_NOTIF_SIZES, 0, &ctx->sizes) < 0) {
pexit("Failed to get notifications size");
return -1;
}

ctx->sreq = xmalloc0(ctx->sizes.seccomp_notif);
Expand All @@ -129,7 +128,6 @@ int seccomp_notify_plugins_load(struct seccomp_notify_context_s **out, const cha
b = strdup(plugins);
if (b == NULL) {
pexit("Failed to strdup");
return -1;
}
for (s = 0, it = strtok_r(b, ":", &saveptr); it; s++, it = strtok_r(NULL, ":", &saveptr)) {
run_oci_seccomp_notify_plugin_version_cb version_cb;
Expand All @@ -139,7 +137,6 @@ int seccomp_notify_plugins_load(struct seccomp_notify_context_s **out, const cha
ctx->plugins[s].handle = dlopen(it, RTLD_NOW);
if (ctx->plugins[s].handle == NULL) {
pexitf("cannot load `%s`: %s", it, dlerror());
return -1;
}

version_cb = (run_oci_seccomp_notify_plugin_version_cb)dlsym(ctx->plugins[s].handle, "run_oci_seccomp_notify_version");
Expand All @@ -149,15 +146,13 @@ int seccomp_notify_plugins_load(struct seccomp_notify_context_s **out, const cha
version = version_cb();
if (version != 1) {
pexitf("invalid version supported by the plugin `%s`", it);
return -1;
}
}

ctx->plugins[s].handle_request_cb =
(run_oci_seccomp_notify_handle_request_cb)dlsym(ctx->plugins[s].handle, "run_oci_seccomp_notify_handle_request");
if (ctx->plugins[s].handle_request_cb == NULL) {
pexitf("plugin `%s` doesn't export `run_oci_seccomp_notify_handle_request`", it);
return -1;
}

start_cb = (run_oci_seccomp_notify_start_cb)dlsym(ctx->plugins[s].handle, "run_oci_seccomp_notify_start");
Expand All @@ -167,7 +162,6 @@ int seccomp_notify_plugins_load(struct seccomp_notify_context_s **out, const cha
ret = start_cb(&opq, conf, sizeof(*conf));
if (ret != 0) {
pexitf("error loading `%s`", it);
return -1;
}
}
ctx->plugins[s].opaque = opq;
Expand Down Expand Up @@ -227,7 +221,6 @@ int seccomp_notify_plugins_event(struct seccomp_notify_context_s *ctx, int secco

default:
pexitf("Unknown handler action specified %d", handled);
return -1;
}
}
}
Expand Down

0 comments on commit 3b447bc

Please sign in to comment.