1
0
mirror of git://git.sv.gnu.org/coreutils.git synced 2026-04-19 02:10:57 +02:00

(openat): Use ?:, not if, to work around GCC bug 4210.

This commit is contained in:
Paul Eggert
2006-06-20 19:20:25 +00:00
parent 8280381dd7
commit 9d5fbcc019
2 changed files with 10 additions and 4 deletions

View 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:

View 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);
}