From 3db52feb1f3b2c07ce0b06ad4a7099fa6efe3fc7 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 13 Dec 1999 13:27:58 +0000 Subject: first pass at updating head branch to be to be the same as the SAMBA_2_0 branch (This used to be commit 453a822a76780063dff23526c35408866d0c0154) --- source3/tests/fcntl_lock.c | 17 ++++++++++++++++- source3/tests/ftruncate.c | 3 +++ source3/tests/getgroups.c | 4 ++++ source3/tests/shared_mmap.c | 4 +++- source3/tests/summary.c | 11 ++++++----- source3/tests/sysv_ipc.c | 2 ++ 6 files changed, 34 insertions(+), 7 deletions(-) (limited to 'source3/tests') diff --git a/source3/tests/fcntl_lock.c b/source3/tests/fcntl_lock.c index a90e00aa00..32aecb8743 100644 --- a/source3/tests/fcntl_lock.c +++ b/source3/tests/fcntl_lock.c @@ -1,5 +1,9 @@ /* test whether fcntl locking works on this system */ +#if defined(HAVE_UNISTD_H) +#include +#endif + #include #include #include @@ -33,7 +37,8 @@ static int sys_waitpid(pid_t pid,int *status,int options) int main(int argc, char *argv[]) { struct flock lock; - int fd, pid, ret, status=1; + int fd, ret, status=1; + pid_t pid; if (!(pid=fork())) { sleep(2); @@ -75,5 +80,15 @@ int main(int argc, char *argv[]) unlink(DATA); +#if defined(WIFEXITED) && defined(WEXITSTATUS) + if(WIFEXITED(status)) { + status = WEXITSTATUS(status); + } else { + status = 1; + } +#else /* defined(WIFEXITED) && defined(WEXITSTATUS) */ + status = (status == 0) ? 0 : 1; +#endif /* defined(WIFEXITED) && defined(WEXITSTATUS) */ + exit(status); } diff --git a/source3/tests/ftruncate.c b/source3/tests/ftruncate.c index 8d5e8942e3..93282782ee 100644 --- a/source3/tests/ftruncate.c +++ b/source3/tests/ftruncate.c @@ -1,6 +1,9 @@ /* test whether ftruncte() can extend a file */ +#if defined(HAVE_UNISTD_H) #include +#endif + #include #include #include diff --git a/source3/tests/getgroups.c b/source3/tests/getgroups.c index 37990e010b..343fd5a184 100644 --- a/source3/tests/getgroups.c +++ b/source3/tests/getgroups.c @@ -7,6 +7,10 @@ array of ints! Ultrix is one culprit */ +#if defined(HAVE_UNISTD_H) +#include +#endif + #include #include #include diff --git a/source3/tests/shared_mmap.c b/source3/tests/shared_mmap.c index fb8a2a32d5..fcef75d0d6 100644 --- a/source3/tests/shared_mmap.c +++ b/source3/tests/shared_mmap.c @@ -1,7 +1,9 @@ /* this tests whether we can use a shared writeable mmap on a file - as needed for the mmap varient of FAST_SHARE_MODES */ +#if defined(HAVE_UNISTD_H) #include +#endif #include #include #include @@ -16,7 +18,7 @@ main() { int *buf; - int i, pid; + int i; int fd = open(DATA,O_RDWR|O_CREAT|O_TRUNC,0666); int count=7; diff --git a/source3/tests/summary.c b/source3/tests/summary.c index 3db510495a..7ff9ea61c9 100644 --- a/source3/tests/summary.c +++ b/source3/tests/summary.c @@ -2,7 +2,7 @@ main() { -#ifndef HAVE_FCNTL_LOCK +#if !(defined(HAVE_FCNTL_LOCK) || defined(HAVE_STRUCT_FLOCK64)) printf("ERROR: No locking available. Running Samba would be unsafe\n"); exit(1); #endif @@ -11,12 +11,13 @@ main() printf("WARNING: no shared memory. Running with slow locking code\n"); #endif -#ifdef HAVE_TRAPDOOR_UID - printf("WARNING: trapdoor uid system - Samba may not operate correctly\n"); +#if !(defined(HAVE_IFACE_IFCONF) || defined(HAVE_IFACE_IFREQ) || defined(HAVE_IFACE_AIX)) + printf("WARNING: No automated network interface determination\n"); #endif -#if !(defined(HAVE_NETMASK_IFCONF) || defined(HAVE_NETMASK_IFREQ) || defined(HAVE_NETMASK_AIX)) - printf("WARNING: No automated netmask determination - use an interfaces line\n"); +#if !(defined(USE_SETEUID) || defined(USE_SETREUID) || defined(USE_SETRESUID) || defined(USE_SETUIDX)) + printf("ERROR: no seteuid method available\n"); + exit(1); #endif #if !(defined(STAT_STATVFS) || defined(STAT_STATVFS64) || defined(STAT_STATFS3_OSF1) || defined(STAT_STATFS2_BSIZE) || defined(STAT_STATFS4) || defined(STAT_STATFS2_FSIZE) || defined(STAT_STATFS2_FS_DATA)) diff --git a/source3/tests/sysv_ipc.c b/source3/tests/sysv_ipc.c index 13956ec6f0..9f0e20957a 100644 --- a/source3/tests/sysv_ipc.c +++ b/source3/tests/sysv_ipc.c @@ -1,7 +1,9 @@ /* this tests whether we can use a sysv shared memory segment as needed for the sysv varient of FAST_SHARE_MODES */ +#if defined(HAVE_UNISTD_H) #include +#endif #include #include #include -- cgit