Patch #1019808 from Federico Schwindt: Return correct socket error when
a default timeout has been set, by using getsockopt() to get the error
condition (instead of trying another connect() call, which seems to be
a Linuxism).

2.5 bugfix candidate, assuming no one reports any problems with this change.
diff --git a/Misc/NEWS b/Misc/NEWS
index f7c7aac..b20273d 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -1120,6 +1120,9 @@
 - Patch #1544279: Improve thread-safety of the socket module by moving
   the sock_addr_t storage out of the socket object.
 
+- Patch #1019808: fix bug that causes an incorrect error to be returned 
+  when a socket timeout is set and a connection attempt fails.
+
 - Speed up function calls into the math module.
 
 - Bug #1588217: don't parse "= " as a soft line break in binascii's