musl - musl - an implementation of the standard library for Linux-based systems

index : musl
musl - an implementation of the standard library for Linux-based systems
summary refs log tree commit diff
path: root/src/fcntl/openat.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/fcntl/openat.c')
-rw-r--r--src/fcntl/openat.c 12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/fcntl/openat.c b/src/fcntl/openat.c
index 634c4bf3..4faeb296 100644
--- a/src/fcntl/openat.c
+++ b/src/fcntl/openat.c
@@ -6,10 +6,14 @@
int openat(int fd, const char *filename, int flags, ...)
{
mode_t mode;
- va_list ap;
- va_start(ap, flags);
- mode = va_arg(ap, mode_t);
- va_end(ap);
+
+ if ((flags & O_CREAT) || (flags & O_TMPFILE) == O_TMPFILE) {
+ va_list ap;
+ va_start(ap, flags);
+ mode = va_arg(ap, mode_t);
+ va_end(ap);
+ }
+
return syscall_cp(SYS_openat, fd, filename, flags|O_LARGEFILE, mode);
}
generated by cgit v1.2.1 (git 2.18.0) at 2025年10月05日 11:08:44 +0000

AltStyle によって変換されたページ (->オリジナル) /