diff options
author | Burt P <pburt0@gmail.com> | 2018-03-14 21:05:34 -0500 |
---|---|---|
committer | Leandro A. F. Pereira <leandro@hardinfo.org> | 2018-04-24 07:41:17 -0700 |
commit | 32ce70d9c65123a0c399ffb85bae536246d84a6c (patch) | |
tree | 58c95f78288808f0dcf26f8e2c982567d2cee5fb /hardinfo | |
parent | 81c95b5b80e46c25f7f4379231a0a187952a8b9c (diff) |
Remove use of g_error() for reporting user error
Instead, print message to stderr and set a non-zero exit value.
Signed-off-by: Burt P <pburt0@gmail.com>
Diffstat (limited to 'hardinfo')
-rw-r--r-- | hardinfo/hardinfo.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/hardinfo/hardinfo.c b/hardinfo/hardinfo.c index b3bef9b5..c47e7bf7 100644 --- a/hardinfo/hardinfo.c +++ b/hardinfo/hardinfo.c @@ -31,6 +31,7 @@ ProgramParameters params = { 0 }; int main(int argc, char **argv) { + int exit_code = 0; GSList *modules; setlocale(LC_ALL, ""); @@ -121,7 +122,8 @@ int main(int argc, char **argv) result = module_call_method_param("benchmark::runBenchmark", params.run_benchmark); if (!result) { - g_error(_("Unknown benchmark ``%s'' or benchmark.so not loaded"), params.run_benchmark); + fprintf(stderr, _("Unknown benchmark ``%s'' or benchmark.so not loaded"), params.run_benchmark); + exit_code = 1; } else { fprintf(stderr, "\n"); g_print("%s\n", result); @@ -156,5 +158,5 @@ int main(int argc, char **argv) moreinfo_shutdown(); DEBUG("finished"); - return 0; + return exit_code; } |