summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDmitry V. Levin <ldv@altlinux.org>2021-05-12 16:00:00 +0000
committerDmitry V. Levin <ldv@altlinux.org>2021-05-12 16:00:00 +0000
commit940b0e7d304459e270ae518d067b40fd82c5caca (patch)
tree9a0970513ae22b2b4fb0c768eff9053f7a5ec523 /src
parent806c1f7a0d08ae2be40b39773ddf16ea5c8a1128 (diff)
downloadelfutils-940b0e7d304459e270ae518d067b40fd82c5caca.tar.gz
elfcompress: fix exit status in case of an error
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.")
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog3
-rw-r--r--src/elfcompress.c2
2 files changed, 4 insertions, 1 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index de130f79..2c7be185 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -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".
diff --git a/src/elfcompress.c b/src/elfcompress.c
index 05f3bc2c..2c6d91ba 100644
--- a/src/elfcompress.c
+++ b/src/elfcompress.c
@@ -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)