]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
(openat): Use ?:, not if, to work around GCC bug 4210.
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 20 Jun 2006 19:20:25 +0000 (19:20 +0000)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 20 Jun 2006 19:20:25 +0000 (19:20 +0000)
lib/ChangeLog
lib/openat.c

index ce97a3c6d3f1e65a175865c8b75703c96aaa3d28..4cf0a6dc076d27b53e2f75bd197d497db225c929 100644 (file)
@@ -1,3 +1,10 @@
+2006-06-20  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * openat.c (openat): Use ?:, not if, to work around GCC bug 4210
+       <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=4210>.
+       Problem reported by Denis Excoffier in
+       <http://lists.gnu.org/archive/html/bug-tar/2006-06/msg00023.html>.
+
 2006-06-19  Jim Meyering  <jim@meyering.net>
 
        Apply this change from gnulib:
index 6a1b42ea6285f916624c0e7cc7316b7b2a015ad6..7df52ea1329576895846a0ff3b6edb736cdbc24f 100644 (file)
@@ -56,10 +56,9 @@ openat (int fd, char const *file, int flags, ...)
       /* If mode_t is narrower than int, use the promoted type (int),
          not mode_t.  Use sizeof to guess whether mode_t is narrower;
          we don't know of any practical counterexamples.  */
-      if (sizeof (mode_t) < sizeof (int))
-       mode = va_arg (arg, int);
-      else
-       mode = va_arg (arg, mode_t);
+      mode = (sizeof (mode_t) < sizeof (int)
+             ? va_arg (arg, int)
+             : va_arg (arg, mode_t));
 
       va_end (arg);
     }