diff options
author | Jeremy Allison <jra@samba.org> | 1999-02-05 21:32:16 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 1999-02-05 21:32:16 +0000 |
commit | 0c78ad41c303bb5f2a2d5667aec5c6ce5c941dc7 (patch) | |
tree | 2a5ed002021b579bbd628a7da4bb15851665d002 | |
parent | a172069b14e6a2f04623020dc1a3d8d039d65fdf (diff) | |
download | samba-0c78ad41c303bb5f2a2d5667aec5c6ce5c941dc7.tar.gz samba-0c78ad41c303bb5f2a2d5667aec5c6ce5c941dc7.tar.xz samba-0c78ad41c303bb5f2a2d5667aec5c6ce5c941dc7.zip |
lib/util_sock.c: Added debug print if core read or write fails to give UNIX errno.
tests/* - Added #if defined(HAVE_UNISTD_H) to help with large file stuff.
Jeremy.
-rw-r--r-- | source/lib/util_sock.c | 6 | ||||
-rw-r--r-- | source/tests/crypttest.c | 3 | ||||
-rw-r--r-- | source/tests/fcntl_lock.c | 4 | ||||
-rw-r--r-- | source/tests/ftruncate.c | 3 | ||||
-rw-r--r-- | source/tests/ftruncroot.c | 3 | ||||
-rw-r--r-- | source/tests/getgroups.c | 4 | ||||
-rw-r--r-- | source/tests/shared_mmap.c | 2 | ||||
-rw-r--r-- | source/tests/summary.c | 2 | ||||
-rw-r--r-- | source/tests/sysv_ipc.c | 2 | ||||
-rw-r--r-- | source/tests/trapdoor.c | 4 |
10 files changed, 30 insertions, 3 deletions
diff --git a/source/lib/util_sock.c b/source/lib/util_sock.c index 6d395659c92..ac3b2f459b8 100644 --- a/source/lib/util_sock.c +++ b/source/lib/util_sock.c @@ -373,6 +373,7 @@ ssize_t read_data(int fd,char *buffer,size_t N) } if (ret == -1) { + DEBUG(0,("read_data: read failure. Error = %s\n", strerror(errno) )); smb_read_error = READ_ERROR; return -1; } @@ -402,7 +403,10 @@ ssize_t write_data(int fd,char *buffer,size_t N) ret = write(fd,buffer + total,N - total); #endif /* WITH_SSL */ - if (ret == -1) return -1; + if (ret == -1) { + DEBUG(0,("write_data: write failure. Error = %s\n", strerror(errno) )); + return -1; + } if (ret == 0) return total; total += ret; diff --git a/source/tests/crypttest.c b/source/tests/crypttest.c index 183ed06394e..c9133f40bee 100644 --- a/source/tests/crypttest.c +++ b/source/tests/crypttest.c @@ -1,4 +1,7 @@ +#if defined(HAVE_UNISTD_H) #include <unistd.h> +#endif + #include <sys/types.h> #ifdef HAVE_STRING_H diff --git a/source/tests/fcntl_lock.c b/source/tests/fcntl_lock.c index a90e00aa000..e0eee4a12ee 100644 --- a/source/tests/fcntl_lock.c +++ b/source/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> diff --git a/source/tests/ftruncate.c b/source/tests/ftruncate.c index 8d5e8942e37..93282782eed 100644 --- a/source/tests/ftruncate.c +++ b/source/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/source/tests/ftruncroot.c b/source/tests/ftruncroot.c index ce3bbbd92c1..36a4adc19df 100644 --- a/source/tests/ftruncroot.c +++ b/source/tests/ftruncroot.c @@ -1,6 +1,9 @@ /* test whether ftruncte() can truncate a file as non-root */ +#if defined(HAVE_UNISTD_H) #include <unistd.h> +#endif + #include <sys/types.h> #include <sys/stat.h> #include <stdio.h> diff --git a/source/tests/getgroups.c b/source/tests/getgroups.c index 37990e010b8..343fd5a184f 100644 --- a/source/tests/getgroups.c +++ b/source/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/source/tests/shared_mmap.c b/source/tests/shared_mmap.c index fb8a2a32d5f..c0b34e19579 100644 --- a/source/tests/shared_mmap.c +++ b/source/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> diff --git a/source/tests/summary.c b/source/tests/summary.c index 3db510495ae..6a3d67132fd 100644 --- a/source/tests/summary.c +++ b/source/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 diff --git a/source/tests/sysv_ipc.c b/source/tests/sysv_ipc.c index 13956ec6f08..9f0e20957a2 100644 --- a/source/tests/sysv_ipc.c +++ b/source/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> diff --git a/source/tests/trapdoor.c b/source/tests/trapdoor.c index e6caf982abf..4696122ef8f 100644 --- a/source/tests/trapdoor.c +++ b/source/tests/trapdoor.c @@ -1,7 +1,9 @@ /* test for a trapdoor uid system */ -#include <stdlib.h> +#if defined(HAVE_UNISTD_H) #include <unistd.h> +#endif +#include <stdlib.h> #include <stdio.h> main() |