]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
install: avoid a portability bug when compiling with non-gcc
authorJim Meyering <meyering@redhat.com>
Thu, 20 Aug 2009 08:36:30 +0000 (10:36 +0200)
committerJim Meyering <meyering@redhat.com>
Thu, 20 Aug 2009 08:46:22 +0000 (10:46 +0200)
* 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

src/install.c

index 73b3981ef4584a48732ded3cbbd23c64b9ddad2d..19efb1d1bc7ae8e2657ec8717c2ff8af1eb85f45 100644 (file)
@@ -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. */