mirror of
https://github.com/chararomandroid/android_device_samsung_a20
synced 2026-08-21 19:55: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 <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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue