commit:     0197559dcb99c91ddaa146322f5100c326e9d5eb
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Thu Jul 26 11:09:59 2018 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu Aug  9 14:08:38 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0197559d

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).

 eclass/desktop.eclass | 4 ++--
 1 file 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}

Reply via email to