summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/bio/bss_acpt.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/bio/bss_acpt.c')
-rw-r--r--src/lib/libcrypto/bio/bss_acpt.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/lib/libcrypto/bio/bss_acpt.c b/src/lib/libcrypto/bio/bss_acpt.c
index 5d49e1a72b..5507a53a2f 100644
--- a/src/lib/libcrypto/bio/bss_acpt.c
+++ b/src/lib/libcrypto/bio/bss_acpt.c
@@ -131,7 +131,7 @@ static int acpt_new(BIO *bi)
131 BIO_ACCEPT *ba; 131 BIO_ACCEPT *ba;
132 132
133 bi->init=0; 133 bi->init=0;
134 bi->num=INVALID_SOCKET; 134 bi->num=-1;
135 bi->flags=0; 135 bi->flags=0;
136 if ((ba=BIO_ACCEPT_new()) == NULL) 136 if ((ba=BIO_ACCEPT_new()) == NULL)
137 return(0); 137 return(0);
@@ -149,7 +149,7 @@ static BIO_ACCEPT *BIO_ACCEPT_new(void)
149 return(NULL); 149 return(NULL);
150 150
151 memset(ret,0,sizeof(BIO_ACCEPT)); 151 memset(ret,0,sizeof(BIO_ACCEPT));
152 ret->accept_sock=INVALID_SOCKET; 152 ret->accept_sock=-1;
153 ret->bind_mode=BIO_BIND_NORMAL; 153 ret->bind_mode=BIO_BIND_NORMAL;
154 return(ret); 154 return(ret);
155 } 155 }
@@ -170,12 +170,12 @@ static void acpt_close_socket(BIO *bio)
170 BIO_ACCEPT *c; 170 BIO_ACCEPT *c;
171 171
172 c=(BIO_ACCEPT *)bio->ptr; 172 c=(BIO_ACCEPT *)bio->ptr;
173 if (c->accept_sock != INVALID_SOCKET) 173 if (c->accept_sock != -1)
174 { 174 {
175 shutdown(c->accept_sock,2); 175 shutdown(c->accept_sock,2);
176 closesocket(c->accept_sock); 176 close(c->accept_sock);
177 c->accept_sock=INVALID_SOCKET; 177 c->accept_sock=-1;
178 bio->num=INVALID_SOCKET; 178 bio->num=-1;
179 } 179 }
180 } 180 }
181 181
@@ -213,14 +213,14 @@ again:
213 return(-1); 213 return(-1);
214 } 214 }
215 s=BIO_get_accept_socket(c->param_addr,c->bind_mode); 215 s=BIO_get_accept_socket(c->param_addr,c->bind_mode);
216 if (s == INVALID_SOCKET) 216 if (s == -1)
217 return(-1); 217 return(-1);
218 218
219 if (c->accept_nbio) 219 if (c->accept_nbio)
220 { 220 {
221 if (!BIO_socket_nbio(s,1)) 221 if (!BIO_socket_nbio(s,1))
222 { 222 {
223 closesocket(s); 223 close(s);
224 BIOerr(BIO_F_ACPT_STATE,BIO_R_ERROR_SETTING_NBIO_ON_ACCEPT_SOCKET); 224 BIOerr(BIO_F_ACPT_STATE,BIO_R_ERROR_SETTING_NBIO_ON_ACCEPT_SOCKET);
225 return(-1); 225 return(-1);
226 } 226 }
@@ -282,7 +282,7 @@ err:
282 if (bio != NULL) 282 if (bio != NULL)
283 BIO_free(bio); 283 BIO_free(bio);
284 else if (s >= 0) 284 else if (s >= 0)
285 closesocket(s); 285 close(s);
286 return(0); 286 return(0);
287 /* break; */ 287 /* break; */
288 case ACPT_S_OK: 288 case ACPT_S_OK: