summaryrefslogtreecommitdiff
path: root/source3/smbwrapper
diff options
context:
space:
mode:
Diffstat (limited to 'source3/smbwrapper')
-rw-r--r--source3/smbwrapper/wrapped.c61
-rw-r--r--source3/smbwrapper/wrapper.h14
2 files changed, 25 insertions, 50 deletions
diff --git a/source3/smbwrapper/wrapped.c b/source3/smbwrapper/wrapped.c
index 10b22b35dd..cf132b31e3 100644
--- a/source3/smbwrapper/wrapped.c
+++ b/source3/smbwrapper/wrapped.c
@@ -20,17 +20,13 @@
*/
+/* we don't want prototypes for this code */
+#define NO_PROTO
+
#include "wrapper.h"
- int open(const char *name, int flags, ...)
+ int open(const char *name, int flags, mode_t mode)
{
- va_list ap;
- mode_t mode;
-
- va_start(ap, flags);
- mode = va_arg(ap, mode_t);
- va_end(ap);
-
if (smbw_path(name)) {
return smbw_open(name, flags, mode);
}
@@ -39,27 +35,13 @@
}
#ifdef HAVE__OPEN
- int _open(const char *name, int flags, ...)
+ int _open(const char *name, int flags, mode_t mode)
{
- va_list ap;
- mode_t mode;
-
- va_start(ap, flags);
- mode = va_arg(ap, mode_t);
- va_end(ap);
-
return open(name, flags, mode);
}
#elif HAVE___OPEN
- int __open(const char *name, int flags, ...)
+ int __open(const char *name, int flags, mode_t mode)
{
- va_list ap;
- mode_t mode;
-
- va_start(ap, flags);
- mode = va_arg(ap, mode_t);
- va_end(ap);
-
return open(name, flags, mode);
}
#endif
@@ -197,14 +179,8 @@
#endif
- int fcntl(int fd, int cmd, ...)
+ int fcntl(int fd, int cmd, long arg)
{
- va_list ap;
- long arg;
- va_start(ap, cmd);
- arg = va_arg(ap, long);
- va_end(ap);
-
if (smbw_fd(fd)) {
return smbw_fcntl(fd, cmd, arg);
}
@@ -214,31 +190,20 @@
#ifdef HAVE___FCNTL
- int __fcntl(int fd, int cmd, ...)
+ int __fcntl(int fd, int cmd, long arg)
{
- va_list ap;
- long arg;
- va_start(ap, cmd);
- arg = va_arg(ap, long);
- va_end(ap);
-
return fcntl(fd, cmd, arg);
}
#elif HAVE__FCNTL
- int _fcntl(int fd, int cmd, ...)
+ int _fcntl(int fd, int cmd, long arg)
{
- va_list ap;
- long arg;
- va_start(ap, cmd);
- arg = va_arg(ap, long);
- va_end(ap);
-
return fcntl(fd, cmd, arg);
}
#endif
+#ifdef HAVE_GETDENTS
int getdents(int fd, struct dirent *dirp, unsigned int count)
{
if (smbw_fd(fd)) {
@@ -247,6 +212,7 @@
return real_getdents(fd, dirp, count);
}
+#endif
#ifdef HAVE___GETDENTS
int __getdents(int fd, struct dirent *dirp, unsigned int count)
@@ -628,12 +594,7 @@
#endif
#ifdef HAVE_UTIMES
-#if LINUX
- /* glibc2 gets the prototype wrong */
- int utimes(const char *name,struct timeval tvp[2])
-#else
int utimes(const char *name,const struct timeval tvp[2])
-#endif
{
if (smbw_path(name)) {
return smbw_utimes(name, tvp);
diff --git a/source3/smbwrapper/wrapper.h b/source3/smbwrapper/wrapper.h
index 25694bd78c..3e7d754c9b 100644
--- a/source3/smbwrapper/wrapper.h
+++ b/source3/smbwrapper/wrapper.h
@@ -21,6 +21,20 @@
#include "config.h"
+#ifdef NO_PROTO
+/* get rid of prototypes */
+#define _NO_PROTO
+
+#ifdef HAVE_SYS_CDEFS_H
+#include <sys/cdefs.h>
+#ifdef __P
+#undef __P
+#define __P(x) ()
+#endif
+#endif
+#endif
+
+
#ifdef HAVE_SYSCALL_H
#include <syscall.h>
#elif HAVE_SYS_SYSCALL_H