X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng-crash%2Flttng-crash.c;h=298ed71a43c2b1b47053156f624aa50b39fd0519;hp=65fca36ae264c2e25f7d0437840a4a8f194f67b7;hb=ef6fc488ca5672ccd46efac9de9db0cfd24bc810;hpb=88ae485a1c83df9b02f0954cf452548e5bd2e168 diff --git a/src/bin/lttng-crash/lttng-crash.c b/src/bin/lttng-crash/lttng-crash.c index 65fca36ae..298ed71a4 100644 --- a/src/bin/lttng-crash/lttng-crash.c +++ b/src/bin/lttng-crash/lttng-crash.c @@ -61,6 +61,14 @@ 0xF1 ^ 0xFF, 0x77 ^ 0xFF, 0xBF ^ 0xFF, 0x17 ^ 0xFF, \ } +static const char *help_msg = +#ifdef LTTNG_EMBED_HELP +#include +#else +NULL +#endif +; + /* * Non-static to ensure the compiler does not optimize away the xor. */ @@ -207,10 +215,10 @@ static struct option long_options[] = { static void usage(void) { - int ret = utils_show_man_page(1, "lttng-crash"); + int ret = utils_show_help(1, "lttng-crash", help_msg); if (ret) { - ERR("Cannot view man page lttng-crash(1)"); + ERR("Cannot show --help for `lttng-crash`"); perror("exec"); exit(EXIT_FAILURE); } @@ -1079,7 +1087,7 @@ int delete_dir_recursive(const char *path) if (!dir) { PERROR("Cannot open '%s' path", path); ret = -errno; - goto end; + goto end_no_closedir; } path_len = strlen(path); @@ -1137,7 +1145,7 @@ int delete_dir_recursive(const char *path) ret = delete_dir_recursive(subpath); free(subpath); if (ret) { - /* Error occured, abort traversal. */ + /* Error occurred, abort traversal. */ goto end; } } else if (S_ISREG(st.st_mode)) { @@ -1162,6 +1170,7 @@ end: if (closeret) { PERROR("closedir"); } +end_no_closedir: return ret; }