fix some close on -1 issues

This commit is contained in:
Anthony Minessale 2013-08-27 13:59:24 -04:00
parent 6ac01bdd1f
commit 782664056c
4 changed files with 9 additions and 2 deletions

View File

@ -1 +1 @@
Wed Nov 7 10:37:54 CST 2012
Tue Aug 27 13:58:18 EDT 2013

View File

@ -32,6 +32,10 @@ static apr_status_t socket_cleanup(void *sock)
{
apr_socket_t *thesocket = sock;
if (thesocket && thesocket->socketdes == -1) {
return APR_SUCCESS;
}
if (close(thesocket->socketdes) == 0) {
thesocket->socketdes = -1;
return APR_SUCCESS;

View File

@ -1 +1 @@
Mon Apr 16 11:52:47 CDT 2012
Tue Aug 27 13:58:32 EDT 2013

View File

@ -100,6 +100,9 @@ int
psf_fclose (SF_PRIVATE *psf)
{ int retval ;
if (psf->filedes =- -1)
return -1; /* already closed */
if (psf->virtual_io)
return 0 ;