Module Name: src
Committed By: christos
Date: Fri Apr 12 19:41:46 UTC 2013
Modified Files:
src/external/bsd/libevent/dist: evutil.c
Log Message:
connect(2) returns EINPROGRESS for "239.10.20.30" which is supposed to
be an unroutable address. getsockopt() to find the actual error returns
0. This is prolly broken, but this temporary work-around fixes the regression
test.
To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/libevent/dist/evutil.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/external/bsd/libevent/dist/evutil.c
diff -u src/external/bsd/libevent/dist/evutil.c:1.2 src/external/bsd/libevent/dist/evutil.c:1.3
--- src/external/bsd/libevent/dist/evutil.c:1.2 Thu Apr 11 12:56:41 2013
+++ src/external/bsd/libevent/dist/evutil.c Fri Apr 12 15:41:45 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: evutil.c,v 1.2 2013/04/11 16:56:41 christos Exp $ */
+/* $NetBSD: evutil.c,v 1.3 2013/04/12 19:41:45 christos Exp $ */
/*
* Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
*
@@ -27,7 +27,7 @@
#include "event2/event-config.h"
#include <sys/cdefs.h>
-__RCSID("$NetBSD: evutil.c,v 1.2 2013/04/11 16:56:41 christos Exp $");
+__RCSID("$NetBSD: evutil.c,v 1.3 2013/04/12 19:41:45 christos Exp $");
#define _GNU_SOURCE
@@ -483,6 +483,15 @@ evutil_socket_connect(evutil_socket_t *f
if (connect(*fd_ptr, sa, socklen) < 0) {
int e = evutil_socket_geterror(*fd_ptr);
+#ifdef __NetBSD__
+ if (e == EINPROGRESS) {
+ socklen_t l = sizeof(e);
+ l = sizeof(e);
+ if (getsockopt(*fd_ptr, SOL_SOCKET, SO_ERROR,
+ (void*)&e, &l) == -1)
+ abort();
+ }
+#endif
if (EVUTIL_ERR_CONNECT_RETRIABLE(e))
return 0;
if (EVUTIL_ERR_CONNECT_REFUSED(e))