summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/common/open.c
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2006-08-30 17:12:51 +0000
committerEric Andersen <andersen@codepoet.org>2006-08-30 17:12:51 +0000
commit245b4053dc63c5e23864fd1a57d595df2a5f06f7 (patch)
tree469e4d44fd87b93dc09a2fdaed5535cbf668d4c1 /libc/sysdeps/linux/common/open.c
parenta4d40bdd8f0abf67dbe24a00eb81bdf82d76da09 (diff)
tweak a few syscalls using varargs
Diffstat (limited to 'libc/sysdeps/linux/common/open.c')
-rw-r--r--libc/sysdeps/linux/common/open.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/libc/sysdeps/linux/common/open.c b/libc/sysdeps/linux/common/open.c
index 580876a26..1a514e62d 100644
--- a/libc/sysdeps/linux/common/open.c
+++ b/libc/sysdeps/linux/common/open.c
@@ -22,19 +22,18 @@ static inline _syscall3(int, __syscall_open, const char *, file,
int, flags, __kernel_mode_t, mode);
libc_hidden_proto(__libc_open)
-int __libc_open(const char *file, int flags, ...)
+int __libc_open(const char *file, int oflag, ...)
{
- /* gcc may warn about mode being uninitialized.
- * Just ignore that, since gcc is wrong. */
- mode_t mode;
-
- if (flags & O_CREAT) {
- va_list ap;
-
- va_start(ap, flags);
- mode = va_arg(ap, mode_t);
- va_end(ap);
+ mode_t mode = 0;
+
+ if (oflag & O_CREAT)
+ {
+ va_list arg;
+ va_start (arg, oflag);
+ mode = va_arg (arg, mode_t);
+ va_end (arg);
}
+
return __syscall_open(file, flags, mode);
}
libc_hidden_def(__libc_open)