universal7885: dlopener: Use more common exit code

This commit is contained in:
roynatech2544 2022-11-30 17:42:18 +09:00
commit 12ee518097

View file

@ -1,27 +1,26 @@
#include <dlfcn.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[]) {
const char *path;
int status = -EINVAL;
void *handle = NULL;
int ret = EXIT_FAILURE;
if (argc <= 1) {
printf("Please specify a module to load!\n");
return status;
return ret;
}
path = argv[1];
handle = dlopen(path, RTLD_NOW);
if (handle == NULL) {
char const *err_str = dlerror();
const char *err_str = dlerror();
printf("load: module=%s\n%s\n", path, err_str ? err_str : "unknown");
status = -EINVAL;
} else {
printf("load: module=%s %s\n", path, "Success!");
ret = EXIT_SUCCESS;
}
return status;
return ret;
}