From: Jim Meyering Date: Thu, 20 Aug 2009 08:36:30 +0000 (+0200) Subject: install: avoid a portability bug when compiling with non-gcc X-Git-Tag: v7.5~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3db7c2c03c4c6daf358925d1c585fcbb478fa25a;p=thirdparty%2Fcoreutils.git install: avoid a portability bug when compiling with non-gcc * src/install.c (extra_mode): Be careful to return only a 0 or 1 value, since this is a "bool" function, and there are still some compilers for which this is necessary. Without this change, Bernhard Voelker reported that the Forte Developer 7 C 5.4 2002/03/09 compiler would produce a malfunctioning "install" binary. Details in http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/17710/focus=17760 --- diff --git a/src/install.c b/src/install.c index 73b3981ef4..19efb1d1bc 100644 --- a/src/install.c +++ b/src/install.c @@ -189,7 +189,7 @@ static bool extra_mode (mode_t input) { const mode_t mask = ~S_IRWXUGO & ~S_IFMT; - return input & mask; + return !! (input & mask); } /* Return true if copy of file SRC_NAME to file DEST_NAME is necessary. */