commit:     3987c6edac86e035b1fa4b629284cdf245d66174
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Fri Aug 11 15:14:55 2017 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Fri Aug 25 13:53:11 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3987c6ed

flag-o-matic.eclass: test-flag-PROG, refactor to reduce duplication

 eclass/flag-o-matic.eclass | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/eclass/flag-o-matic.eclass b/eclass/flag-o-matic.eclass
index b2f3742b3ec..0393a30b74c 100644
--- a/eclass/flag-o-matic.eclass
+++ b/eclass/flag-o-matic.eclass
@@ -433,11 +433,15 @@ test-flag-PROG() {
                # Use -c so we can test the assembler as well.
                -c -o /dev/null
        )
-       if "${cmdline[@]}" -x${lang} - </dev/null >/dev/null 2>&1 ; then
-               "${cmdline[@]}" "${flag}" -x${lang} - </dev/null >/dev/null 2>&1
+       if "${cmdline[@]}" -x${lang} - </dev/null &>/dev/null ; then
+               cmdline+=( "${flag}" -x${lang} - )
        else
-               "${cmdline[@]}" "${flag}" -c -o /dev/null /dev/null >/dev/null 
2>&1
+               # XXX: what's the purpose of this? does it even work with
+               # any compiler?
+               cmdline+=( "${flag}" -c -o /dev/null /dev/null )
        fi
+
+       "${cmdline[@]}" </dev/null &>/dev/null
 }
 
 # @FUNCTION: test-flag-CC

Reply via email to