From 43ac25c2de7ba21fb8f9e4d4db0c01c1408da0b8 Mon Sep 17 00:00:00 2001 From: "Dmitry V. Levin" Date: Wed, 12 May 2021 15:00:00 +0000 Subject: [PATCH] elfcompress: fix exit status regression in case of "Nothing to do" When elfcompress decides that no section data needs to be updated and therefore the file does not have to be rewritten, it still has to exit with a zero status indicating success. Resolves: https://sourceware.org/bugzilla/show_bug.cgi?id=27856 Fixes: c497478390de ("elfcompress: Replace cleanup() with label") --- src/ChangeLog | 4 ++++ src/elfcompress.c | 1 + 2 files changed, 5 insertions(+) diff --git a/src/ChangeLog b/src/ChangeLog index c5ecc05b8..47c7eb79e 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2021-05-12 Dmitry V. Levin + + * elfcompress.c (process_file): Set res to 0 in case of "Nothing to do". + 2021-04-19 Martin Liska * elfclassify.c (run_classify): Use startswith. diff --git a/src/elfcompress.c b/src/elfcompress.c index d5bc33006..7340e878b 100644 --- a/src/elfcompress.c +++ b/src/elfcompress.c @@ -522,6 +522,7 @@ process_file (const char *fname) if (verbose > 0) printf ("Nothing to do.\n"); fnew = NULL; + res = 0; goto cleanup; } -- 2.47.2