Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

scripts/decodecode: return 0 on success

The decodecode script always returns an exit code of 1, regardless of
whether the operation was successful or not. This is because the
"cleanup" function, which is registered to run on any script exit via
"trap cleanup EXIT", contains an unconditional "exit 1".

Remove the "exit 1" from the "cleanup" function so that it only performs
the necessary file cleanup without forcing a non-zero exit status.

Do that to ensure successful script executions now exit with code 0.
Exits due to errors are all handled by the "die()" function and will still
correctly exit with code 1.

Link: https://lkml.kernel.org/r/20260318150545.2809311-1-derkling@google.com
Signed-off-by: Patrick Bellasi <derkling@google.com>
Acked-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Patrick Bellasi and committed by
Andrew Morton
b8822d73 0f8e38ee

+1 -2
+1 -2
scripts/decodecode
··· 12 12 13 13 cleanup() { 14 14 rm -f $T $T.s $T.o $T.oo $T.aa $T.dis 15 - exit 1 16 15 } 17 16 18 17 die() { ··· 48 49 49 50 if [ -z "$code" ]; then 50 51 rm $T 51 - exit 52 + die "Code line not found" 52 53 fi 53 54 54 55 echo $code