]> git.baikalelectronics.ru Git - kernel.git/commit
selftests, bpftool: Set EXIT trap after usage function
authorQuentin Monnet <quentin.monnet@netronome.com>
Tue, 19 Nov 2019 10:50:09 +0000 (10:50 +0000)
committerAlexei Starovoitov <ast@kernel.org>
Mon, 25 Nov 2019 00:58:45 +0000 (16:58 -0800)
commit95cfb42c24f4114df4e041b366d2b1bae3f00729
treec6a62ad38a8a7cc87f6389a3723b0f6b2445d296
parentc8eb68b72916b629e1fbe8ff8df1ab2ed0cc5f29
selftests, bpftool: Set EXIT trap after usage function

The trap on EXIT is used to clean up any temporary directory left by the
build attempts. It is not needed when the user simply calls the script
with its --help option, and may not be needed either if we add checks
(e.g. on the availability of bpftool files) before the build attempts.

Let's move this trap and related variables lower down in the code, so
that we don't accidentally change the value returned from the script
on early exits at pre-checks.

Signed-off-by: Quentin Monnet <quentin.monnet@netronome.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Reviewed-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Link: https://lore.kernel.org/bpf/20191119105010.19189-2-quentin.monnet@netronome.com
tools/testing/selftests/bpf/test_bpftool_build.sh