summaryrefslogtreecommitdiff
path: root/libc/sysdeps
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
parenta4d40bdd8f0abf67dbe24a00eb81bdf82d76da09 (diff)
tweak a few syscalls using varargs
Diffstat (limited to 'libc/sysdeps')
-rw-r--r--libc/sysdeps/linux/common/__syscall_fcntl64.c2
-rw-r--r--libc/sysdeps/linux/common/ioctl.c2
-rw-r--r--libc/sysdeps/linux/common/open.c21
-rw-r--r--libc/sysdeps/linux/common/open64.c14
-rw-r--r--libc/sysdeps/linux/common/ptrace.c2
5 files changed, 20 insertions, 21 deletions
diff --git a/libc/sysdeps/linux/common/__syscall_fcntl64.c b/libc/sysdeps/linux/common/__syscall_fcntl64.c
index a1daa7375..5d80f1849 100644
--- a/libc/sysdeps/linux/common/__syscall_fcntl64.c
+++ b/libc/sysdeps/linux/common/__syscall_fcntl64.c
@@ -24,8 +24,8 @@ int __libc_fcntl64(int fd, int cmd, ...)
va_start(list, cmd);
arg = va_arg(list, long);
-
va_end(list);
+
return (__syscall_fcntl64(fd, cmd, arg));
}
libc_hidden_def(__libc_fcntl64)
diff --git a/libc/sysdeps/linux/common/ioctl.c b/libc/sysdeps/linux/common/ioctl.c
index e4e710a71..ce2fb39a0 100644
--- a/libc/sysdeps/linux/common/ioctl.c
+++ b/libc/sysdeps/linux/common/ioctl.c
@@ -24,8 +24,8 @@ int ioctl(int fd, unsigned long int request, ...)
va_start(list, request);
arg = va_arg(list, void *);
-
va_end(list);
+
return __syscall_ioctl(fd, request, arg);
}
libc_hidden_def(ioctl)
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)
diff --git a/libc/sysdeps/linux/common/open64.c b/libc/sysdeps/linux/common/open64.c
index 93a27e9bd..1c40b3e9b 100644
--- a/libc/sysdeps/linux/common/open64.c
+++ b/libc/sysdeps/linux/common/open64.c
@@ -23,17 +23,17 @@ libc_hidden_proto(__libc_open)
libc_hidden_proto(__libc_open64)
int __libc_open64 (const char *file, int oflag, ...)
{
- int mode = 0;
+ mode_t mode = 0;
- if (oflag & O_CREAT)
+ if (oflag & O_CREAT)
{
- va_list arg;
- va_start (arg, oflag);
- mode = va_arg (arg, int);
- va_end (arg);
+ va_list arg;
+ va_start (arg, oflag);
+ mode = va_arg (arg, mode_t);
+ va_end (arg);
}
- return __libc_open(file, oflag | O_LARGEFILE, mode);
+ return __libc_open(file, oflag | O_LARGEFILE, mode);
}
libc_hidden_def(__libc_open64)
diff --git a/libc/sysdeps/linux/common/ptrace.c b/libc/sysdeps/linux/common/ptrace.c
index fda2e9d84..56a21e5ce 100644
--- a/libc/sysdeps/linux/common/ptrace.c
+++ b/libc/sysdeps/linux/common/ptrace.c
@@ -12,7 +12,7 @@
#define __NR___syscall_ptrace __NR_ptrace
-static inline _syscall4(long, __syscall_ptrace, enum __ptrace_request, request,
+static inline _syscall4(long, __syscall_ptrace, enum __ptrace_request, request,
__kernel_pid_t, pid, void*, addr, void*, data);
long int