From 12ee518097e7d904b145d491d7535646c806cbdf Mon Sep 17 00:00:00 2001 From: roynatech2544 Date: Wed, 30 Nov 2022 17:42:18 +0900 Subject: [PATCH] universal7885: dlopener: Use more common exit code --- .../debug-tools/dlopener/dlopener.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/universal7885-common/debug-tools/dlopener/dlopener.c b/universal7885-common/debug-tools/dlopener/dlopener.c index dcf5105..8fd59d7 100644 --- a/universal7885-common/debug-tools/dlopener/dlopener.c +++ b/universal7885-common/debug-tools/dlopener/dlopener.c @@ -1,27 +1,26 @@ #include -#include #include +#include 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; }