ERR: Fix some HP specific warnings

This commit is contained in:
Bill Hoffman 2003-05-07 10:27:32 -04:00
parent c5a0dfa1d1
commit a43ce2c320
4 changed files with 27 additions and 7 deletions

View File

@ -269,9 +269,13 @@ static CURLcode bindlocal(struct connectdata *conn,
/* we succeeded to bind */
struct sockaddr_in add;
size = sizeof(add);
#ifdef __hpux
int gsize = sizeof(add);
#else
socklen_t gsize = sizeof(add);
#endif
if(getsockname(sockfd, (struct sockaddr *) &add,
(socklen_t *)&size)<0) {
&gsize)<0) {
failf(data, "getsockname() failed");
return CURLE_HTTP_PORT_FAILED;
}
@ -337,7 +341,11 @@ static
int socketerror(int sockfd)
{
int err = 0;
#ifdef __hpux
int errSize = sizeof(err);
#else
socklen_t errSize = sizeof(err);
#endif
if( -1 == getsockopt(sockfd, SOL_SOCKET, SO_ERROR,
(void *)&err, &errSize))

View File

@ -142,11 +142,15 @@ static CURLcode AllowServerConnect(struct SessionHandle *data,
/* we have received data here */
{
int s;
#ifdef __hpux
int size = sizeof(struct sockaddr_in);
#else
socklen_t size = sizeof(struct sockaddr_in);
#endif
struct sockaddr_in add;
getsockname(sock, (struct sockaddr *) &add, (socklen_t *)&size);
s=(int)accept(sock, (struct sockaddr *) &add, (socklen_t *)&size);
getsockname(sock, (struct sockaddr *) &add, &size);
s=(int)accept(sock, (struct sockaddr *) &add, &size);
sclose(sock); /* close the first socket */
@ -1220,7 +1224,11 @@ CURLcode ftp_use_port(struct connectdata *conn)
if(! *myhost) {
/* pick a suitable default here */
#ifdef __hpux
int sslen;
#else
socklen_t sslen;
#endif
sslen = sizeof(sa);
if (getsockname(conn->firstsocket, (struct sockaddr *)&sa, &sslen) < 0) {
@ -1259,7 +1267,11 @@ CURLcode ftp_use_port(struct connectdata *conn)
if(bind(portsock, (struct sockaddr *)&sa, size) >= 0) {
/* we succeeded to bind */
struct sockaddr_in add;
#ifdef __hpux
int socksize = sizeof(add);
#else
socklen_t socksize = sizeof(add);
#endif
if(getsockname(portsock, (struct sockaddr *) &add,
&socksize)<0) {

View File

@ -454,7 +454,7 @@ void rec_wont(struct connectdata *conn, int option)
}
}
void set_local_option(struct connectdata *conn, int option, int newstate)
static void set_local_option(struct connectdata *conn, int option, int newstate)
{
struct TELNET *tn = (struct TELNET *)conn->proto.telnet;
if(newstate == YES)

View File

@ -1391,8 +1391,8 @@ static int handleSock5Proxy(
int sock)
{
unsigned char socksreq[600]; /* room for large user/pw (255 max each) */
int actualread;
int written;
ssize_t actualread;
ssize_t written;
CURLcode result;
Curl_nonblock(sock, FALSE);