fix some close on -1 issues
This commit is contained in:
parent
c60dfb50d5
commit
7c5b5ce8a4
|
@ -1 +1 @@
|
||||||
Wed Nov 7 10:37:54 CST 2012
|
Tue Aug 27 13:58:18 EDT 2013
|
||||||
|
|
|
@ -32,6 +32,10 @@ static apr_status_t socket_cleanup(void *sock)
|
||||||
{
|
{
|
||||||
apr_socket_t *thesocket = sock;
|
apr_socket_t *thesocket = sock;
|
||||||
|
|
||||||
|
if (thesocket && thesocket->socketdes == -1) {
|
||||||
|
return APR_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
if (close(thesocket->socketdes) == 0) {
|
if (close(thesocket->socketdes) == 0) {
|
||||||
thesocket->socketdes = -1;
|
thesocket->socketdes = -1;
|
||||||
return APR_SUCCESS;
|
return APR_SUCCESS;
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Mon Apr 16 11:52:47 CDT 2012
|
Tue Aug 27 13:58:32 EDT 2013
|
||||||
|
|
|
@ -100,6 +100,9 @@ int
|
||||||
psf_fclose (SF_PRIVATE *psf)
|
psf_fclose (SF_PRIVATE *psf)
|
||||||
{ int retval ;
|
{ int retval ;
|
||||||
|
|
||||||
|
if (psf->filedes =- -1)
|
||||||
|
return -1; /* already closed */
|
||||||
|
|
||||||
if (psf->virtual_io)
|
if (psf->virtual_io)
|
||||||
return 0 ;
|
return 0 ;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue