]> 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)
commit50ab15500fe130bfabccdbc0a0f6180ad14e5f83
treec6a62ad38a8a7cc87f6389a3723b0f6b2445d296
parent49735f36c448095d3cb4d0a7f0ffad87297dacf3
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