mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
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:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user