projects
/
yaz-moved-to-github.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Improve check for type of socket length (socklen_t).
[yaz-moved-to-github.git]
/
comstack
/
tcpip.c
diff --git
a/comstack/tcpip.c
b/comstack/tcpip.c
index
dac5b2a
..
a7d33d2
100644
(file)
--- a/
comstack/tcpip.c
+++ b/
comstack/tcpip.c
@@
-2,7
+2,7
@@
* Copyright (c) 1995-2002, Index Data
* See the file LICENSE for details.
*
* Copyright (c) 1995-2002, Index Data
* See the file LICENSE for details.
*
- * $Id: tcpip.c,v 1.46 2002-02-19 20:02:40 adam Exp $
+ * $Id: tcpip.c,v 1.49 2002-09-20 22:23:13 adam Exp $
*/
#include <stdio.h>
*/
#include <stdio.h>
@@
-53,6
+53,10
@@
void *tcpip_straddr(COMSTACK h, const char *str);
#define TRC(X)
#endif
#define TRC(X)
#endif
+#ifndef YAZ_SOCKLEN_T
+#define YAZ_SOCKLEN_T int
+#endif
+
/* this state is used for both SSL and straight TCP/IP */
typedef struct tcpip_state
{
/* this state is used for both SSL and straight TCP/IP */
typedef struct tcpip_state
{
@@
-449,11
+453,7
@@
int tcpip_listen(COMSTACK h, char *raddr, int *addrlen,
void *cd)
{
struct sockaddr_in addr;
void *cd)
{
struct sockaddr_in addr;
-#ifdef __cplusplus
- socklen_t len = sizeof(addr);
-#else
- int len = sizeof(addr);
-#endif
+ YAZ_SOCKLEN_T len = sizeof(addr);
TRC(fprintf(stderr, "tcpip_listen pid=%d\n", getpid()));
if (h->state != CS_ST_IDLE)
TRC(fprintf(stderr, "tcpip_listen pid=%d\n", getpid()));
if (h->state != CS_ST_IDLE)
@@
-679,6
+679,9
@@
int tcpip_get(COMSTACK h, char **buf, int *bufsize)
#endif
#endif
|| errno == EINPROGRESS
#endif
#endif
|| errno == EINPROGRESS
+#ifdef __sun__
+ || errno == ENOENT /* Sun's sometimes set errno to this */
+#endif
)
{
h->io_pending = CS_WANT_READ;
)
{
h->io_pending = CS_WANT_READ;
@@
-965,7
+968,7
@@
char *tcpip_addrstr(COMSTACK h)
struct sockaddr_in addr;
tcpip_state *sp = (struct tcpip_state *)h->cprivate;
char *r, *buf = sp->buf;
struct sockaddr_in addr;
tcpip_state *sp = (struct tcpip_state *)h->cprivate;
char *r, *buf = sp->buf;
- size_t len;
+ YAZ_SOCKLEN_T len;
struct hostent *host;
len = sizeof(addr);
struct hostent *host;
len = sizeof(addr);