diff options
author | Andrew Tridgell <tridge@samba.org> | 1998-10-07 05:58:09 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 1998-10-07 05:58:09 +0000 |
commit | 77aea37bb83f2b9ad541f851b003ca10b9811314 (patch) | |
tree | d928694a64d029f345ca79a88cda06b1767b194c | |
parent | 50526c45ba7920b15b6947edc8bc714a00d80f79 (diff) | |
download | samba-77aea37bb83f2b9ad541f851b003ca10b9811314.tar.gz samba-77aea37bb83f2b9ad541f851b003ca10b9811314.tar.xz samba-77aea37bb83f2b9ad541f851b003ca10b9811314.zip |
- no getdents on OSF1
- try a new method of handling prototype mismatches in wrapped.c. We
now try to disable prototypes!
-rwxr-xr-x | source/configure | 4 | ||||
-rw-r--r-- | source/configure.in | 4 | ||||
-rw-r--r-- | source/include/config.h.in | 6 | ||||
-rw-r--r-- | source/smbwrapper/wrapped.c | 61 | ||||
-rw-r--r-- | source/smbwrapper/wrapper.h | 14 |
5 files changed, 35 insertions, 54 deletions
diff --git a/source/configure b/source/configure index adeda77b41f..028fd7bdb98 100755 --- a/source/configure +++ b/source/configure @@ -1940,7 +1940,7 @@ else fi done -for ac_hdr in sys/acl.h +for ac_hdr in sys/acl.h sys/cdefs.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 @@ -4352,7 +4352,7 @@ else fi done -for ac_func in _getdents __getdents _lseek __lseek _read __read +for ac_func in getdents _getdents __getdents _lseek __lseek _read __read do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 echo "configure:4359: checking for $ac_func" >&5 diff --git a/source/configure.in b/source/configure.in index 4f549bcf1db..276e3847b88 100644 --- a/source/configure.in +++ b/source/configure.in @@ -62,7 +62,7 @@ AC_CHECK_HEADERS(sys/statfs.h sys/dustat.h sys/statvfs.h stdarg.h sys/sockio.h) AC_CHECK_HEADERS(shadow.h netinet/tcp.h sys/security.h security/pam_appl.h) AC_CHECK_HEADERS(stropts.h poll.h readline.h history.h readline/readline.h) AC_CHECK_HEADERS(readline/history.h sys/capability.h sysacll.h sys/syscall.h) -AC_CHECK_HEADERS(sys/acl.h) +AC_CHECK_HEADERS(sys/acl.h sys/cdefs.h) AC_CHECK_SIZEOF(int,cross) AC_CHECK_SIZEOF(long,cross) @@ -194,7 +194,7 @@ AC_CHECK_FUNCS(__xstat __fxstat __lxstat) AC_CHECK_FUNCS(_stat _lstat _fstat __stat __lstat __fstat) AC_CHECK_FUNCS(_acl __acl _facl __facl _open __open _chdir __chdir) AC_CHECK_FUNCS(_close __close _fchdir __fchdir _fcntl __fcntl) -AC_CHECK_FUNCS(_getdents __getdents _lseek __lseek _read __read) +AC_CHECK_FUNCS(getdents _getdents __getdents _lseek __lseek _read __read) AC_CHECK_FUNCS(_write __write _fork __fork) AC_CHECK_FUNCS(_stat64 __stat64 _fstat64 __fstat64 _lstat64 __lstat64) AC_CHECK_FUNCS(llseek _llseek __llseek readdir64 _readdir64 __readdir64) diff --git a/source/include/config.h.in b/source/include/config.h.in index 92056f075af..289f06f0a23 100644 --- a/source/include/config.h.in +++ b/source/include/config.h.in @@ -408,6 +408,9 @@ /* Define if you have the getcwd function. */ #undef HAVE_GETCWD +/* Define if you have the getdents function. */ +#undef HAVE_GETDENTS + /* Define if you have the getgrnam function. */ #undef HAVE_GETGRNAM @@ -654,6 +657,9 @@ /* Define if you have the <sys/capability.h> header file. */ #undef HAVE_SYS_CAPABILITY_H +/* Define if you have the <sys/cdefs.h> header file. */ +#undef HAVE_SYS_CDEFS_H + /* Define if you have the <sys/dir.h> header file. */ #undef HAVE_SYS_DIR_H diff --git a/source/smbwrapper/wrapped.c b/source/smbwrapper/wrapped.c index 10b22b35dd4..cf132b31e30 100644 --- a/source/smbwrapper/wrapped.c +++ b/source/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/source/smbwrapper/wrapper.h b/source/smbwrapper/wrapper.h index 25694bd78c1..3e7d754c9ba 100644 --- a/source/smbwrapper/wrapper.h +++ b/source/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 |