summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorThomas Radke <tradke@aei.mpg.de>2000-11-08 20:36:06 (GMT)
committerThomas Radke <tradke@aei.mpg.de>2000-11-08 20:36:06 (GMT)
commit4c52fde41aa4fd1b5ab58f4c26a5f1a955cc2462 (patch)
treec8a6107a690bf8407a464515388a8ecbc95ab51c /src
parentb7170a25ceb924da4ccf2a589e84680d92526a17 (diff)
downloadhdf5-4c52fde41aa4fd1b5ab58f4c26a5f1a955cc2462.zip
hdf5-4c52fde41aa4fd1b5ab58f4c26a5f1a955cc2462.tar.gz
hdf5-4c52fde41aa4fd1b5ab58f4c26a5f1a955cc2462.tar.bz2
[svn-r2817]
Purpose: Bugfix Description: The socklen_t was hardcoded to be defined as int on architectures other than Linux and SUN (Solaris). Now it turned out that Solaris isn't consistent in this manner. Versions earlier than 2.7 do not define this type. Solution: Check at configure time whether the socklen_t type is defined by the system header includes. If not than this type is defined to be 'int'. Platforms tested: Solaris 2.6 and 2.7 Linux IRIX64 Windows NT (command line configure with both cl abd gcc)
Diffstat (limited to 'src')
-rw-r--r--src/H5FDstream.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/H5FDstream.c b/src/H5FDstream.c
index d31d802..a60ec6c 100644
--- a/src/H5FDstream.c
+++ b/src/H5FDstream.c
@@ -33,8 +33,12 @@
#include <H5FDstream.h> /* Stream VFD header */
#ifdef H5FD_STREAM_HAVE_UNIX_SOCKETS
+#ifdef H5_HAVE_SYS_TYPES_H
#include <sys/types.h> /* socket stuff */
+#endif
+#ifdef H5_HAVE_SYS_SOCKET_H
#include <sys/socket.h> /* socket stuff */
+#endif
#include <netdb.h> /* gethostbyname */
#include <netinet/in.h> /* socket stuff */
#ifdef HAVE_NETINET_TCP_H
@@ -42,6 +46,9 @@
#endif
#endif
+#ifndef HAVE_STRUCT_SOCKLEN_T
+typedef int socklen_t;
+#endif
/* Some useful macros */
#ifdef MIN
@@ -534,7 +541,7 @@ static void H5FDstream_read_from_socket (H5FD_stream_t *stream,
}
/* now receive the next chunk of data */
- size = recv (stream->socket, ptr, max_size, 0);
+ size = recv (stream->socket, ptr, (int) max_size, 0);
if (size < 0 && (EINTR == errno || EAGAIN == errno || EWOULDBLOCK))
{
@@ -775,9 +782,6 @@ static herr_t H5FD_stream_flush (H5FD_t *_stream)
int on = 1;
unsigned char *ptr;
struct sockaddr from;
-#if !(defined(linux) || defined(sun))
- typedef int socklen_t;
-#endif
socklen_t fromlen;
H5FD_STREAM_SOCKET_TYPE sock;