From: Josh Poimboeuf Date: Tue, 15 Dec 2015 15:39:34 +0000 (-0600) Subject: perf tools: Document the fact that parse_options*() may exit X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=24a88bdd05d5de32f3a56a4dcc5070c97d4a514f;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git perf tools: Document the fact that parse_options*() may exit Generally, calling exit() from a library is bad practice. Eventually these functions might be redesigned so that they don't exit. For now, just document the fact that they do. Signed-off-by: Josh Poimboeuf Cc: Jiri Olsa Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/97b1af06cc3b18dd0f49e655d6d659eaa64ecde5.1450193761.git.jpoimboe@redhat.com Signed-off-by: Arnaldo Carvalho de Melo --- diff --git a/tools/perf/util/parse-options.h b/tools/perf/util/parse-options.h index 1231960d6148..d1544069c7c0 100644 --- a/tools/perf/util/parse-options.h +++ b/tools/perf/util/parse-options.h @@ -152,6 +152,9 @@ struct option { /* parse_options() will filter out the processed options and leave the * non-option argments in argv[]. * Returns the number of arguments left in argv[]. + * + * NOTE: parse_options() and parse_options_subcommand() may call exit() in the + * case of an error (or for 'special' options like --list-cmds or --list-opts). */ extern int parse_options(int argc, const char **argv, const struct option *options,