From 7afbd60266372af1f73d401127832983230ab420 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Fri, 16 Nov 2012 11:51:42 -0500 Subject: [PATCH] Use EVUTIL_SOCKET_ERROR() wrapper to save/restor errno in evhttp_connection_fail_ --- http.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/http.c b/http.c index 03305e56..22a46a95 100644 --- a/http.c +++ b/http.c @@ -681,7 +681,7 @@ void evhttp_connection_fail_(struct evhttp_connection *evcon, enum evhttp_connection_error error) { - const int errsave = errno; + const int errsave = EVUTIL_SOCKET_ERROR(); struct evhttp_request* req = TAILQ_FIRST(&evcon->requests); void (*cb)(struct evhttp_request *, void *); void *cb_arg; @@ -731,7 +731,7 @@ evhttp_connection_fail_(struct evhttp_connection *evcon, * Let's restore the original errno, so that the user's * callback can have a better idea of what the error was. */ - errno = errsave; + EVUTIL_SET_SOCKET_ERROR(errsave); /* inform the user */ if (cb != NULL) -- 2.40.0