[uClibc-cvs] uClibc/libc/sysdeps/linux/common syscalls.c,1.103,1.104

David McCullough davidm at uclibc.org
Tue Apr 29 14:41:52 UTC 2003


Update of /var/cvs/uClibc/libc/sysdeps/linux/common
In directory winder:/tmp/cvs-serv7614/libc/sysdeps/linux/common

Modified Files:
	syscalls.c 
Log Message:

Fixup __libc_open to use varargs and match the prototype.

On the H8 varargs are rather unusual and if you declare a function with
varargs,  it had better use them or it won't work.



Index: syscalls.c
===================================================================
RCS file: /var/cvs/uClibc/libc/sysdeps/linux/common/syscalls.c,v
retrieving revision 1.103
retrieving revision 1.104
diff -u -d -r1.103 -r1.104
--- syscalls.c	2 Mar 2003 10:41:06 -0000	1.103
+++ syscalls.c	29 Apr 2003 14:41:48 -0000	1.104
@@ -80,11 +80,16 @@
 #ifdef L___syscall_open
 #define __NR___syscall_open __NR_open
 #include <stdarg.h>
-/* Do not include fcntl.h, so gcc doesn't whine the prototype */
+#include <fcntl.h>
 static inline
 _syscall3(int, __syscall_open, const char *, fn, int, flags, __kernel_mode_t, mode);
-int __libc_open (const char * fn, int flags, mode_t mode)
+int __libc_open (const char * fn, int flags, ...)
 {
+      va_list ap;
+      mode_t mode;
+      va_start(ap, flags);
+	  mode = va_arg(ap, mode_t);
+	  va_end(ap);
 	  return __syscall_open(fn, flags, mode);
 }
 



More information about the uClibc-cvs mailing list