summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2018-07-26 13:09:59 +0200
committerMichał Górny <mgorny@gentoo.org>2018-08-09 16:08:38 +0200
commit0197559dcb99c91ddaa146322f5100c326e9d5eb (patch)
tree2fc4c2925f55eff24dc70e366671be832e34e99c /eclass/desktop.eclass
parentdesktop.eclass: domenu, fix dying on non-existing files (diff)
downloadgentoo-0197559dcb99c91ddaa146322f5100c326e9d5eb.tar.gz
gentoo-0197559dcb99c91ddaa146322f5100c326e9d5eb.tar.bz2
gentoo-0197559dcb99c91ddaa146322f5100c326e9d5eb.zip
desktop.eclass: domenu, fix potential overflow in exit status
While increasing exit status for each failure may seem brilliant at first, it serves no purpose and has an overflow risk. For example, if domenu counted 256 failures, the exit status would be truncated to 0 (success).
Diffstat (limited to 'eclass/desktop.eclass')
-rw-r--r--eclass/desktop.eclass4
1 files changed, 2 insertions, 2 deletions
diff --git a/eclass/desktop.eclass b/eclass/desktop.eclass
index 1684a21d21f..8f2c6d55c29 100644
--- a/eclass/desktop.eclass
+++ b/eclass/desktop.eclass
@@ -251,11 +251,11 @@ domenu() {
if [[ -d ${i} ]] ; then
for j in "${i}"/*.desktop ; do
doins "${j}"
- ((ret+=$?))
+ ((ret|=$?))
done
else
doins "${i}"
- ((ret+=$?))
+ ((ret|=$?))
fi
done
exit ${ret}