]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
(rpl_openat): Use the promoted type (int), not mode_t,
authorJim Meyering <jim@meyering.net>
Sat, 8 Oct 2005 09:05:08 +0000 (09:05 +0000)
committerJim Meyering <jim@meyering.net>
Sat, 8 Oct 2005 09:05:08 +0000 (09:05 +0000)
as second argument to va_arg.  Otherwise, some versions of gcc
warn that `if this code is reached, the program will abort'.

lib/openat.c

index 929d264924c4cf93fe38ec0031044ddc15099ec0..092e39610d02db5e8c1e0f9b6de32b4cf153b266 100644 (file)
@@ -55,11 +55,8 @@ rpl_openat (int fd, char const *file, int flags, ...)
     {
       va_list arg;
       va_start (arg, flags);
-
-      /* Assume that mode_t is passed compatibly with mode_t's type
-        after argument promotion.  */
-      mode = va_arg (arg, mode_t);
-
+      /* Use the promoted type (int), not mode_t, as second argument.  */
+      mode = (mode_t) va_arg (arg, int);
       va_end (arg);
     }