summaryrefslogtreecommitdiff
path: root/source3/tests
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>1999-12-13 13:27:58 +0000
committerAndrew Tridgell <tridge@samba.org>1999-12-13 13:27:58 +0000
commit3db52feb1f3b2c07ce0b06ad4a7099fa6efe3fc7 (patch)
tree866dd15416c3d8554bb207709f433a87ad0c012d /source3/tests
parentf6276724bafdb6145c0c7b565172d80cb04516ea (diff)
downloadsamba-3db52feb1f3b2c07ce0b06ad4a7099fa6efe3fc7.tar.gz
samba-3db52feb1f3b2c07ce0b06ad4a7099fa6efe3fc7.tar.bz2
samba-3db52feb1f3b2c07ce0b06ad4a7099fa6efe3fc7.zip
first pass at updating head branch to be to be the same as the SAMBA_2_0 branch
(This used to be commit 453a822a76780063dff23526c35408866d0c0154)
Diffstat (limited to 'source3/tests')
-rw-r--r--source3/tests/fcntl_lock.c17
-rw-r--r--source3/tests/ftruncate.c3
-rw-r--r--source3/tests/getgroups.c4
-rw-r--r--source3/tests/shared_mmap.c4
-rw-r--r--source3/tests/summary.c11
-rw-r--r--source3/tests/sysv_ipc.c2
6 files changed, 34 insertions, 7 deletions
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 <unistd.h>
+#endif
+
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
@@ -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 <unistd.h>
+#endif
+
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
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 <unistd.h>
+#endif
+
#include <sys/types.h>
#include <stdio.h>
#include <unistd.h>
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 <unistd.h>
+#endif
#include <sys/mman.h>
#include <sys/types.h>
#include <sys/stat.h>
@@ -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 <unistd.h>
+#endif
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/ipc.h>