mirror of
https://github.com/chararomandroid/android_device_samsung_a20
synced 2026-08-23 04:25:33 -04:00
universal7885: dlopener: Use more common exit code
This commit is contained in:
parent
7ea8d02949
commit
12ee518097
1 changed files with 6 additions and 7 deletions
|
|
@ -1,27 +1,26 @@
|
||||||
#include <dlfcn.h>
|
#include <dlfcn.h>
|
||||||
#include <errno.h>
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
int main(int argc, char *argv[]) {
|
int main(int argc, char *argv[]) {
|
||||||
const char *path;
|
const char *path;
|
||||||
int status = -EINVAL;
|
|
||||||
void *handle = NULL;
|
void *handle = NULL;
|
||||||
|
int ret = EXIT_FAILURE;
|
||||||
|
|
||||||
if (argc <= 1) {
|
if (argc <= 1) {
|
||||||
printf("Please specify a module to load!\n");
|
printf("Please specify a module to load!\n");
|
||||||
return status;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
path = argv[1];
|
path = argv[1];
|
||||||
|
|
||||||
handle = dlopen(path, RTLD_NOW);
|
handle = dlopen(path, RTLD_NOW);
|
||||||
if (handle == NULL) {
|
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");
|
printf("load: module=%s\n%s\n", path, err_str ? err_str : "unknown");
|
||||||
status = -EINVAL;
|
|
||||||
} else {
|
} else {
|
||||||
printf("load: module=%s %s\n", path, "Success!");
|
printf("load: module=%s %s\n", path, "Success!");
|
||||||
|
ret = EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
return ret;
|
||||||
return status;
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue