tests: Fix build with clang

clang doesn't like mode_t type as an argument to va_arg():

error: second argument to 'va_arg' is of promotable type 'mode_t' (aka
'unsigned short'); this va_arg has undefined behavior because arguments
will be promoted to 'int'

    mode = va_arg(ap, mode_t);
                      ^~~~~~

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
This commit is contained in:
Jiri Denemark 2017-10-05 09:06:03 +02:00
parent 000e950455
commit 2925f9395e
2 changed files with 2 additions and 2 deletions

View File

@ -267,7 +267,7 @@ int open(const char *path, int flags, ...)
*/
if (flags & O_CREAT) {
va_start(ap, flags);
mode = va_arg(ap, mode_t);
mode = (mode_t) va_arg(ap, int);
va_end(ap);
}

View File

@ -101,7 +101,7 @@ int open(const char *pathname, int flags, ...)
*/
if (flags & O_CREAT) {
va_start(ap, flags);
mode = va_arg(ap, mode_t);
mode = (mode_t) va_arg(ap, int);
va_end(ap);
}