summaryrefslogtreecommitdiff
path: root/lib/openat.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2005-10-08 09:05:08 +0000
committerJim Meyering <jim@meyering.net>2005-10-08 09:05:08 +0000
commit40bf0efd47387010a4dafa8d07146643c8e00aaa (patch)
treec7fdbc99482d9dbb56db0abfc7a9d8367e87bd02 /lib/openat.c
parentf754c25d4cb79c179964f50cdc44a5e0dc37736d (diff)
downloadcoreutils-40bf0efd47387010a4dafa8d07146643c8e00aaa.tar.xz
(rpl_openat): Use the promoted type (int), not mode_t,
as second argument to va_arg. Otherwise, some versions of gcc warn that `if this code is reached, the program will abort'.
Diffstat (limited to 'lib/openat.c')
-rw-r--r--lib/openat.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/lib/openat.c b/lib/openat.c
index 929d26492..092e39610 100644
--- a/lib/openat.c
+++ b/lib/openat.c
@@ -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);
}