mirror of
https://github.com/cuberite/libevent.git
synced 2025-09-19 09:15:34 -04:00
Use EVUTIL_SOCKET_ERROR() wrapper to save/restor errno in evhttp_connection_fail_
This commit is contained in:
parent
29fea33a7c
commit
7afbd60266
4
http.c
4
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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user