]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
elfcompress: fix exit status in case of an error
authorDmitry V. Levin <ldv@altlinux.org>
Wed, 12 May 2021 16:00:00 +0000 (16:00 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Wed, 12 May 2021 16:00:00 +0000 (16:00 +0000)
Exit status of 255 in case of an error is probably not what elfcompress
users expect, change it to 1.

Reported-by: Vitaly Chikunov <vt@altlinux.org>
Fixes: 92acb57eb046 ("elfcompress: New utility.")
src/ChangeLog
src/elfcompress.c

index de130f792c377f6910d91000ed2cf0ff251eafd5..2c7be185ba116c495270583618106b18756135ed 100644 (file)
@@ -1,5 +1,8 @@
 2021-05-12  Dmitry V. Levin  <ldv@altlinux.org>
 
+       * elfcompress.c (process_file): Return 1 instead of -1 in case of an
+       error.
+
        * elfcompress.c (process_file): Remove redundant assignment in case of
        "Nothing to do".
 
index 05f3bc2ca772309ce93f3dea6e31f7e708bc68b9..2c6d91ba2ea1b19c22ba5114e16a1f7a5230a023 100644 (file)
@@ -298,7 +298,7 @@ process_file (const char *fname)
 
   /* How many sections are we talking about?  */
   size_t shnum = 0;
-  int res = -1;
+  int res = 1;
 
   fd = open (fname, O_RDONLY);
   if (fd < 0)