Save connect errno so that we get a correct connect failure reason
libratbox r25358 (androsyn)
This commit is contained in:
parent
b68b0b2cde
commit
9b4f3c47e1
|
@ -21,7 +21,7 @@
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
|
||||||
* USA
|
* USA
|
||||||
*
|
*
|
||||||
* $Id: commio.c 25038 2008-01-23 16:03:08Z androsyn $
|
* $Id: commio.c 25358 2008-05-13 14:48:46Z androsyn $
|
||||||
*/
|
*/
|
||||||
#include <libratbox_config.h>
|
#include <libratbox_config.h>
|
||||||
#include <ratbox_lib.h>
|
#include <ratbox_lib.h>
|
||||||
|
@ -470,6 +470,7 @@ rb_connect_callback(rb_fde_t *F, int status)
|
||||||
{
|
{
|
||||||
CNCB *hdl;
|
CNCB *hdl;
|
||||||
void *data;
|
void *data;
|
||||||
|
int errtmp = errno; /* save errno as rb_settimeout clobbers it sometimes */
|
||||||
|
|
||||||
/* This check is gross..but probably necessary */
|
/* This check is gross..but probably necessary */
|
||||||
if(F == NULL || F->connect == NULL || F->connect->callback == NULL)
|
if(F == NULL || F->connect == NULL || F->connect->callback == NULL)
|
||||||
|
@ -479,8 +480,10 @@ rb_connect_callback(rb_fde_t *F, int status)
|
||||||
data = F->connect->data;
|
data = F->connect->data;
|
||||||
F->connect->callback = NULL;
|
F->connect->callback = NULL;
|
||||||
|
|
||||||
|
|
||||||
/* Clear the timeout handler */
|
/* Clear the timeout handler */
|
||||||
rb_settimeout(F, 0, NULL, NULL);
|
rb_settimeout(F, 0, NULL, NULL);
|
||||||
|
errno = errtmp;
|
||||||
/* Call the handler */
|
/* Call the handler */
|
||||||
hdl(F, status, data);
|
hdl(F, status, data);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue